三、程序分析题 (本大题共5 小题,每小题5 分,共25 分) 阅读下列程序,将输出结果写到各题右侧的空白处 31. int a = 200; main() {int i; for(i = 1;i< = 5;i + +) {a + + ; printf(″﹪d,″,a); s() } { s() {static int a = 20; a + + ; printf(″﹪d \ n″,a); } 32. # include ″stdio.h″ main() {char c; c = getchar(); if(c> =′a′&&c< =′z′) ‖c> =′X′&&c< =′Z′)c = c - 23; printf(″﹪c \ n″,c); } 设从键盘上输入Next ↙ 33. # define N 7 main() {int i,j,temp,a[N]={1,2,3,4,5,6,7}; for(i = 0;i{j = N - 1 - i; temp = a[i];a[i]=a[j];a[j]=temp; } for(i = 0;i} 34. struct porb {char * name; int count; }x[]={″Li ning″,19,″Lang ping″,21,″Zhu jian hua″,20}; main() {int i; for(i = 0;i<3;i + + ) printf(″﹪s: ﹪d \ n″,x[i].name,x[i].count); } 35. main() {union {short a;char ch; }M; M.a = 100;M.ch =′A′; printf(″﹪d,﹪d,﹪c \n″,sizeof(M),M.a,M.ch); } |