nice
verynice
nicegood
verygood
第1题:
有以下程序: #include <stdio.h>point ( char * p) { p + = 3; }main( ) char b[4] = {'a','b','c','d'} , *p=b; point(p); printf( "% c \n" , * p);
A.a
B.b
C.c
D.d
第2题:
下列程序的运行结果是( )。
#include<stdio.h>
#include<string.h>
main()
{ char*s1="abDuj";
char*s2="ABdUG";
int t;
t=strcmp(s1,s2) ;
printf("%d",t);
}
A.正数
B.负数
C.零
D.不确定的值
第3题:
有以下程序 #include <stdio.h> void fun(char *t, char *s) { while(*t!=0) t++; while( (*t++ = *s++ )!=0 ); main() { char ss[10]="acc",aa[10]="bbxxyy"; fun(ss, aa); printff"%s,%s\n", ss,aa); 程序的运行结果是
A.accxyy, bbxxyy
B.acc, bbxxyy
C.accxxyy, bbxxyy
D.accbbxxyy, bbxxyy
第4题:
有以下程序: #include<stdio.h> void fun(char *a,char*B){while(*a=='*')a++; while(*b=*A){b++;a++;} } main() {char*s="****a*b****",t[80]; fun(s,t);puts(t); } 程序的运行结果是( )。
A.*****a*b
B.a*b
C.a*b****
D.ab
第5题:
设有下列程序:
include<stdio.h>
include<string.h>
main()
{ int i;
char si 10],ti 10];
gets(t);
for(i=0;i<2;i++)
{ gets(s);
if(strcmp(t,s)<0)strcpy(t,s);
}
printf("%s\n",t);
}
程序运行后,从键盘上输入(<CR>代表回车符):CDEF<CR>BADEF<CR>QTHRG<CR>,则程序的输出结果是______。
第6题:
有以下程序: #include <stdio.h> main( ) { chars[] ="Yes\n/No",*ps=s; puts(ps +4); * (pa +4) =0; puts(s); }程序运行后的输出结果是( )。
A.n/No Yes /No
B./No Yes
C./NO Yes /No
D.n/No Yes
第7题:
有以下程序 #include <stdio.h> main() { char a=4; printf("%d/n,a=a<<1); } 程序的运行结果是______。
A.40
B.16
C.8
D.4
第8题:
请读程序: # includde<stdio.h> # include<string.> void fun(char * s) {char a[10]; strcpy(a,"STRING"); s=a; } main() { char*p; fun(p); print{("%s\n",p); } 上面程序的输出结果(表示空格) ( )
A.STRING
B.STRING
C.STRING
D.不确定的值
第9题:
有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t){ char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);}main( ){ char str[10] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
第10题:
有以下程序
#include <stdio.h>
void fun(char *t,char *s)
{ while(*t!=0) t++;
while((*t++=*s++)!=0);
}
main( )
{ char ss[10]="acc",aa[10]="bbxxyy";
fun(ss,aa); printf("%s,%s\n",ss,aa);
}
程序的运行结果是
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
第11题:
以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz"; strcpy(ar+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是______。
A.xyzabcABC
B.zabeABC
C.yzabcABC
D.xyabcABC
第12题:
有以下程序: #include <stdio.h> int fun(char s[]) { int n=0; while(*s<='9'&&*s>='0') {n=10*n+*s-'0';s++;} return(n); } main() { char s[10]={'6','1','*','4','*','9','*','0','*'}; printf("%d\n",fun(s)); } 程序的运行结果是( )。
A.9
B.61490
C.61
D.5
第13题:
有以下程序 #include <stdio.h> int fun(char s[]) { int n=O; while(*s<='9'&&*s>='0') { n=10*n+*s-'0'; s++; } return (n); } main() { char s[10]={ '6', '1', '*', '4', '*', '9', '*', '0', '*'}; printf("%d\n",fun(s)); }
A.9
B.61490
C.61
D.5
第14题:
有以下程序 #include <stdio.h> void fun(char **p) { ++p; printf("%s\n",*p); } main() { char *a[]={"Moming","Afternoon","Evening","Night"}; fun(a); } 程序的运行结果是
A.Afternoon
B.fternoon
C.Morning
D.orning
第15题:
有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。
A.15
B.16
C.12
D.59
第16题:
有以下程序 #include <stdio.h> int fun(char s[]) { int n=0; while(*s<='9'&&*s>='0') {n=10*n+*s-'0';s++;} return(n); } main() {char s[10]={'6','1','*','4','*','9','*','0','*'}; printf("%d\n",fun(s)); } 程序的运行结果是
A.9
B.61490
C.61
D.5
第17题:
有以下程序 #include <stdio.h> #include <string.h> void fun(char *s[],int n) { char *t; int i,j; for(i=0;i<n-1;++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i];s[j];s[j]=t;} } main() { char *ss[]={"bcc
A.xy,aaaacc
B.aaaacc,xy
C.bcc,aabcc
D.aabcc,bcc
第18题:
以下程序的输出结果是( )。 #include <stdio.h> #include <string.h> main() { char str[12]={'s','t','r','i','n','g'}; printf("%d\n",strlen(str) ); }
A.6
B.7
C.11
D.12
第19题:
有以下程序 #include <stdio.h> main() { FILE*pf, char *s1="China",*s2="Beijing"; pf=fopen("abc.dat","wb+"); fwrite(s2,7,1,pf); rewind(pf); /*文件位置指针回到文件开头*/ fwrite(s1,5,1,pf); fclose(pf); } 以上程序执行后abc.dat文件的内容是______。
A.China
B.Chinang
C.ChinaBeijing
D.BeijingChina
第20题:
以下程序: #include<stdio.h> main() {char str[10]; scanf("%s",&str); printf("%s\n",str); } 运行上面的程序,输入字符串how are you,则程序的执行结果是( )。
A.how
B.how are you
C.h
D.howareyou
第21题:
有以下程序
#include <stdio.h>
int fun(char s[ ])
{ int n=0;
while(*s<='9'&&*s>='0') {n=10*n+*s-'0';s++;}
retum(n);
}
main( )
{ char s[10]={'6','1','*','4','*','9','*','0','*'};
printf("%d\n",fun(s));
}
程序的运行结果是
A.9
B.61490
C.61
D.5
第22题:
有以下程序:#include <stdio.h>void swap(char * x,ehar * y){ char t; t= *x; *x: *y; *y=t;main ( ){ char *s1 ="abc", * s2 ="123"; swap(s1 ,s2); printf("%s,%s \n" ,s1 ,s2);}程序执行后的输出结果是( )。
A.123,abe
B.abe,123
C.1bc,a23
D.321,cba
第23题:
有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是( )。
A.2
B.3
C.4
D.5
第24题:
nice
verynice
nicegood
verygood