四、程序填充题
36. (1) j = i + 1
(2) >
(3) b [i] = b [j]
37. (1) digit = 0, blank = 0, other = 0
(2) c> =′0′&&c< = ′9′
(3) ++ other或者other ++
38. (1) &a[i] 或者a + i
(2) x = = a[i]
(3) <五、程序设计题
下述答案仅供参考,若采用其它方法答案,只要正确实现题目要求即可。
39. main ()
{int i
for(i = 10;i< = 1000;i ++ )
if((i﹪2 = = 0)&&(i﹪3 = = 0)&&(i﹪7 = = 0))
printf(″i = ﹪d n″,i);
}
40. main ()
{int a = 0, b = 0, i;
for(i = 2;i< = 100;i + = 2)
{ 2 + = i;b + = i - 1;}
printf(″Sum of even number = ﹪d n″,a);
printf(″Sum of odd number = ﹪d n″,b);
}
41. # include″string.h″
main ()
{int i, n;static char str[80];
gets(str);n = strlen(str);
for(i = 0;iif(str[i]! = str[n - 1 -i])
{printf(″No! n″);break;}
if(i = = n/2) printf(″Yes! n″);