#include<stdio.h>
main()
{
int i=1,sum=0;
while(i<=100)
{
if(i%2==0)
sum=sum-i;
else
sum=sum+i;
i++;
}
printf("the result is :%d\n",sum);
getch();
}
上面这个怎么样? 我
main()
{
int i=1,sum=0;
while(i<=100)
{
if(i%2==0)
sum=sum-i;
else
sum=sum+i;
i++;
}
printf("the result is :%d\n",sum);
getch();
}
上面这个怎么样? 我