有以下程序 include<stdio.h> include<string_h> structA {inta;charb[10];doublec;); void
A.1002,ChangRong,1202.0
B.1001,ChangRong,1098.0
C.1001,ZhangDa,1098.0
D.1002,ZhangDa,1202.0
A.1002,ChangRong,1202.0
B.1001,ChangRong,1098.0
C.1001,ZhangDa,1098.0
D.1002,ZhangDa,1202.0
第1题
有以下程序: include<stdio.h> yoidfun(char*c) { while(*c) { if(*c>=aa&&*c<=z)*c=*c=*(*a-A); C++; } } yoidmain() { chars[81]; gets(s);fun(s);puts(s); } 当执行程序时从键盘上输入HelloBeijing<回车>,则程序的输出结果是
A.HELLOBEIJING
B.HelloBeijing
C.helloBeijing
D.hELLOBeijing
第2题
A.-1,1
B.2,2
C.1,2
D.-2,1
第3题
有以下程序,其中函数f的功能是将多个字符串按字典顺序排序。()
#include<string.h> void f(char *p[],int n) { char *t; int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n; j++) if(strcmp(p[i],p[j])>0){t=p[i];p[i]=p[j];p[j]=t;} } main() { char *p[5] ={“ abc”, “aabdfg ” ,“abbd”, “dcdbe”, “cd”}
A.6
B.4
C.3
D.2
第4题
以下程序的输出结果是【 】。 include <stdio.h> deftne JFT(x)x*x main() { int a,k=3; a=++JFT(k+1); printf("%d",a); }
第5题
以下程序的输出结果是______。 include<stdio.h> main() { double a=1234.56789; printf("%8.4f,%8.2f\n",a,a); }
第6题
以下程序运行后,输出结果是______。 include<stdio.h> define PT 5.5 difine S(x) PT*x*x main() { int a=1,b=2; printf("%4.1f/n",S(a+b)); }
A.49.5
B.9.5
C.22
D.45
第7题
以下程序运行后,输出结果是 define PT 5.5 define S(x) PT*x*x include<stdio.h> main() { int a=1,b=2; printf("%4.1f\n",S(a+b));}
A.49.5
B.9.5
C.22
D.45
第8题
以下程序运行后的输出结果是______。 inClude <strinq.h> char *ss(char *s) { char *p;t; p=S+1;t=*s; while(*p){*(p-1)=*p;p++;} *(p-1)=t; return s; } main() { char *p,str[10]="abcdefgh"; p=ss(str); printf("%s\n",p); }
第9题
以下程序运行后的输出结果是【 】。 include <stdio.h> msin() { int i,n[]={0,0,0,0,0}; for(i=1;i<=4;i++) { n[i]=n[i-1]*2+1; printf("%d",n[i]); } }
第10题
A.出错
B.6
C.3
D.2
第11题
以下程序用业统计文件十字符个数。请填空。 include "stdio.h" main() { FTLE *fp; long num=OL; if((fp=fopen("fname.dat","r"))==NUlL) { pirntf("Open error\n"); exit(0);} while() { fgetc(fp); num++; } printf("num=%1d\n",num-1); fclose(fp); }