各位大哥 这个哪错了
#include <stdio.h>
int main()
{
int i = 1; int sum = 0; int flag = 1;
for (i = 1; i <= 100;i++);
{ sum += i + sum*flag;
flag *= -1;}
printf("sum=%d\n",sum)
return 0;
}
#include <stdio.h>
int main()
{
int i = 1; int sum = 0; int flag = 1;
for (i = 1; i <= 100;i++);
{ sum += i + sum*flag;
flag *= -1;}
printf("sum=%d\n",sum)
return 0;
}
2015-07-22
举报