#include<stdio.h>
int main(void)
{
int i,n;
double sum;
printf("Enter n: ");
scanf("%d",&n);
while(i<=n)
{
i=0;
sum=0;
if(i%2=0);
sum=sum+1/(3i-1);
i++;
if(i%2=1);
sum=sum-1/(3i-1);
i++;
}
printf("sum=%.3f",sum);
return 0;
}
检测得结果是test.c:14: error: invalid lvalue in assignment
test.c:17: error: invalid lvalue in assignment(就是那俩if语句)