请读程序: # include<stdio.h> f(char * s) {cahr * p=s; while(* p!='\0')p++; return(p-s); } main() {printf("%d\n”,f("ABCDEF"));} 上面程序的输出结果是 ( )
A.3
B.6
C.8
D.0
第1题:
有如下的程序: int f(char*s) { char *p=s; while(*p!='\0') p++; return(p-s); }如果在主程序中用下述语句调用上述函数,则输出结果为______。 printf("%d\n",f("best one!"));
A.3
B.6
C.8
D.9
第2题:
请读程序: # include<stdio.h> Char fun(char*c) (if(c<='z'& & * c>='A') * c-='A'-'a' return * c; } main() { char s[81],* p=s; gets(s); while(* p) { * p=fun(p);putchar(* p);p + +; puchar('\n'); } 若运行时从键盘上输入OPEN THE DOOR <CR>(<CR>表示回车),则上面程序的输出结果是 ( )
A.oPEN tHE dOOR
B.ope the door
C.OPEN THE DOOR
D.Open The Door
第3题:
以下程序运行后的输出结果是______。 ss(char*s) { char*p=s; while(*p)p++; return(p-s); } main() { char*a="abded";int i; i=ss(a); printf("%d\n",i); }
A.8
B.7
C.6
D.5
第4题:
以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }
A.3
B.6
C.8
D.0
第5题:
以下程序运行后,输出结果是( ) #include<stdio.h> ss(char *s) { char*p=s; while(*p) p++ return(p-s); } main() { char *a="abded" int i; i=ss(a) ; printf("%d\n",i); }
A.8
B.7
C.6
D.5