发布时间:2023-11-03 20:41来源:www.sf1369.com作者:宇宇
double intergral(double (* fx)(double x), double a, double b) {
const double dx = 0.000001;
double toReturn = .0;
while(fabs(a - b) >= dx) {
toReturn += dx * fx(a);
a += dx;
}
return toReturn;
}
/* MinGW下通过 */
#include<stdio.h>
void main()
{
int sum=0,i,s,n,lengh,high;
printf(please input n\n);
scanf(%d,&n);
for(i=0;i<n;i++)
{
printf(please input num.%d lengh\n,i+1);
scanf(%d,&lengh);
printf(please input num.%d high\n,i+1);
scanf(%d,&high);
s = lengh*high;
sum=sum+s;
}
printf(the sum =%d\n,sum);
}
应该用的是shape控件吧,假定控件名是shape1
shapae1.shape=0,是矩形,shapae1.shape=1,是正方形,shapae1.shape=2,椭圆,shapae1.shape=3,是圆......