求1-3+5-7+......-99+101的值
求1-3+5-7+......-99+101的值#include <stdio.h>
#include <math.h>
main ()
{int t,sum,s;
t=1;
sum=0;
s=1;
while (fabs(t)<=101)
{sum+=t;
t+=2;
s=-s;
t=s*t;
}
printf ("sum = %d\n",sum);
}问下上边哪里有错```为什么编译完显示不出东西~
2008-03-08 10:50

2008-03-08 11:01

2008-03-08 11:16

2008-03-08 13:34

2008-03-08 15:40

2008-03-08 15:56
2008-03-08 15:59
2008-03-08 16:04
2008-03-08 17:06
2008-03-08 19:54