计算1+2+…+99,可以同时省略for循环的三个表达式,写成如下形式,请填空。 #include void main______ { int s=0,i=1: for (; ;) { if ______ [填空1] ; s = s+i; [填空2]; } printf(“s=%d”,s);} 填空1:break 填空2:i++s=0,i=1: for (; ;) { if ______ [填空1] ; s = s+i; [填空2]; } printf(“s=%d”,s);} 填空1:break 填空2:i++
查看答案
以下程序利用辗转相除法求出两个正整数的最大公约数,请填空。 main______ { int m,n,g; scanf("%d%d",&m,&n); g=m%n; while ______ { m=[填空2]; n=g; g= [填空3]; } printf("最大公约数:%d\n",n); } 填空1: g!=0 填空2: n 填空3: m%n g=m%n; while ______ { m=[填空2]; n=g; g= [填空3]; } printf("最大公约数:%d\n",n); } 填空1: g!=0 填空2: n 填空3: m%n
do…while循环语句的while后的______ 不可以省略。
3. The stars and stripes ______ (is, are) their national emblem.
Forty divided by eight ______ (is, are) five.