计算1到M(M为偶数)之间的奇数之和和偶数之和#include #define M 100main(){ int a,b,c,i;clrscr();a=0;c=0;for(i=1;___(1)___;i+=2){ a+=i;___(2)___;c+=b; }printf("sum of evens is %d\n",c);printf("sum of odds is %d\n",a); }结果··SUM OF EVENS IS 2500SUM OF ODDS IS 2500
问题描述:
计算1到M(M为偶数)之间的奇数之和和偶数之和
#include
#define M 100
main()
{ int a,b,c,i;
clrscr();
a=0;c=0;
for(i=1;___(1)___;i+=2)
{ a+=i;
___(2)___;
c+=b; }
printf("sum of evens is %d\n",c);
printf("sum of odds is %d\n",a);
}
结果··SUM OF EVENS IS 2500
SUM OF ODDS IS 2500
答
AA
答
要填空吗?但你的结果好像是错的,1+2+.+100=5050,但你的结果两个加起来只有5000啊
(1)i