编程计算1+3+5+……+101的值
#include <stdio.h>
void main()
{ int i, sum = 0;
for (i = 1; ; )
sum = sum + i;
printf("sum=%d\n", sum); }
i<=101 i+=2
i <= 101
i += 2
i<=101
i=i+2
i<=101 i=i+2
i〈=101 i+=2
i<=101 i++
i+2
i+=2
i<=101;i+=2
i<=101;i+=2
i<=101;i++
int main() {
int i, sum = 0;
for (i = 1; i<=101; i++)
printf("sum=%d\n", sum);
return 0;
}
·
Q
i<=101; i++ ;
i<102 i=i+2
i<=101;i=i+2
i<=101下一题
i<100;i+=2
i<100
i++
1
i<102 i+=2
i<=101,i=i➕2
i<=101,i=i+2
i <= 101 i += 2
i
i<=101 i+2
i < 102
i<101;1+2
i<102
1.i<=101 2.i+=2
int i,sum = 0; for(i = 1;i<=101;i=i+2){ sum = sum+i; } printf("sum = %d\n",sum); }
i≤10 i=2+i
1<=101 i+=2
// 编程计算1+3+5+……+101的值
for (i = 1; i<=101 ; i=i+2 )
#include void main() { int i, sum = 0; for (i = 1; i<=101 ; i=i+2; ) sum = sum + i; printf("sum=%d\n", sum); }
王泽茂 回复 王泽茂: 是i+2,没注意看题
Nature 回复 王泽茂: 应该是i+=2哦
i<102 i+2
i <= 102 i +=2
#include <stdi...
用户登录可进行刷题及查看答案
for (i = 1; i<=101 ; i=i+2; )
登录后提交答案