#include <stdio.h> int main() { int sum=0; int i=1; int flag=1; for(i=1;i<=100;i++); { sum+=i*flag; flag*=-1; } printf("sum=%d\n",sum); return 0; }
for(i=1;i<=100;i++);
for语句后面不应有分号呀!!!