C语言经典入门里面的题
# include <stdio.h>int main(void)
{
int a=2, b=3, c=4;
double data[100], i;
double sum1=0, sum2=0; sum=0;
for(i=0; i<100; i++)
{
data[i]=1/(a++ + b++ + c++);
if((i%2==0) ? '+':'-')
sum += data[i];
}
sum = sum * 4.0 + 3.0;
printf("%lf\n", sum);
return 0;
}
这段是哪里出问题了,大大指正一下