简单点的分的话,就是固定其中一个边,对另个边划分;要是两个边都划分的话,有点复杂;我只写了个划分一个边的。
/* Note:Your choice is C IDE */
#include "stdio.h"
#define x0
2
#define x1
5
#define y0
0
#define y1
9
#define N
10
void main()
{
float sum,s,x,p,f0,f1;
int i=1;
sum=(x1-x0)*(y1-y0);
s=sum/N;
x=s/(y1-y0);
printf(" The area can be devied int %d small ones as follows:\n",N);
f0=y0;
f1=y1;
for(p=x0;p<=x1;i++)
{
printf("%.2f<=x<=%.2f,%.2f<=y<=%.2f.
",p,p+x,f0,f1);
if(i%10==0)
printf("\n");
p+=x;
}
}