网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
【单选题】当运行以下程序时,从键盘输My Book<回车>,则下面程序的运行结果是()。 #include <stdio.h> char fun(char *s) { if(*s<='Z'&&*s>='A') *s+=1; return *s; } int main() { char c[80],*p=c; gets(c); while(*p) { *p=fun(p); putchar(*p); p++; } printf("n"); return 0; }
A.mZ bPPk
B.my book
C.Ny Cook
D.My Book
参考答案和解析
v0=13,v1=4,v2=12
更多 “【单选题】当运行以下程序时,从键盘输My Book<回车>,则下面程序的运行结果是()。 #include <stdio.h> char fun(char *s) { if(*s<='Z'*s>='A') *s+=1; return *s; } int main() { char c[80],*p=c; gets(c); while(*p) { *p=fun(p); putchar(*p); p++; } printf("n"); return 0; }A.mZ bPPkB.my bookC.Ny CookD.My Book” 相关考题
考题
有以下程序:includevoid fun(char**p){++P;printf("%s\n",*p);}main()char*a[]={"Morn
有以下程序: #include<stdio.h> void fun(char**p) { ++P;printf("%s\n",*p);} main() char*a[]={"Morning","Afternoon","Evening","Night"}; fun(A); } 程序的运行结果是( )。A.AfternoonB.fternoonC.MorningD.oring
考题
下列程序的输出结果是______。 includef(char 8s){char *p=s;while(*p!='\0')p++;retur
下列程序的输出结果是______。# include<stdio.h>f(char 8s){ char *p=s; while(*p!='\0')p++; return(p-s);}main(){ printf("%d\n",f("ABCDEF"));}A.3B.6C.8D.0
考题
以下程序的输出结果是()。includecharcchar(chareh){if(ch>='A,ch
以下程序的输出结果是( )。 #include <stdio.h> charcchar(char eh) { if(ch>='A,ch<='Z') ch=ch-'A'+'a'; return ch; } main() { char s[]="ABC+abc=defDEF",*p=s; while(*p) { *p=cchsr(*p); p++; } printf("%s\n",s); }A.abc+ABC=DEFdefB.abc+abc=defdefC.abcABCDEFdefD.abcabcdefdef
考题
以下程序运行后的输出结果是( )。includechar*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);}
考题
有以下程序 include void fun(char **p) { ++p; printf("%s\n",*p);
有以下程序 #include <stdio.h> void fun(char **p) { ++p; printf("%s\n",*p); } main() { char *a[]={"Moming","Afternoon","Evening","Night"}; fun(a); } 程序的运行结果是A.AfternoonB.fternoonC.MorningD.orning
考题
以下程序的输出结果是______。includeincludefun(char*w,int n){ char t,*s
以下程序的输出结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171
考题
有以下程序: include main( ) {char s[ ] ="159" , * p;p=s;printf( "% c", * p + +
有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。A.15B.16C.12D.59
考题
以下程序的输出结果是______。includeincludefun(char *w,int n){ char t,*
以下程序的输出结果是______。 #include<stdio.h> #include<siring.h> fun(char *w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char *p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171
考题
下列程序的执行结果是______。 in(f(char*s) { char*p=s; while(*p!='\0')p++; return(p-s); } main() { printf("%d\n",f("goodbye!")); }A.3B.6C.8D.0
考题
以下程序运行后,输出结果是______。includess(char*s){char *p=s; while(*.p)p++; retu
以下程序运行后,输出结果是______。#include<stdio.h>ss (char *s){ char *p=s; while(*.p)p++; return(p-s);}main(){ char *a="abded"; int i; i=ss((A); print ("%d\n",i);}A.8B.7C.6D.5
考题
设有如下函数定义,则输出结果为______。 char*fun (char*str) {char*p=str; while(*p) { if(*p>'d') continue; p++; } return p; } main() { printf("%s\n",fun("welcome!")); }A.welcome!B.come!C.wD.程序陷入死循环中
考题
请读程序: includef(char * s){cahr * p=s;while(* p!='\0')p++;return(p-s);}main(){
请读程序: # include<stdio.h> f(char * s) {cahr * p=s; while(* p!='\0')p++; return(p-s); } main() {printf("%d\n”,f("ABCDEF"));} 上面程序的输出结果是 ( )A.3B.6C.8D.0
考题
以下程序的输出结果是()。includeint fun (char*s){char *p=s;while (*p!='\0,) p++
以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }A.3B.6C.8D.0
考题
下列程序运行后,输出结果是______。 include include fun(char *w ,int
下列程序运行后,输出结果是______。 #include <stdio. h> #include <string. h> fun (char *w ,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while (s1<s2) { t=*s1++; *s1=*s2--; *s2=t; } } main () { char *p; p="1234567"; fun (p, strlen (p)); puts (p); }A.1234567B.7654321C.1711717D.7177171
考题
以下程序的输出结果是_______。includeincludefun(char*w,int n){char t,*s
以下程序的输出结果是_______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++: *sl=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.1234567B.7654321C.1711717D.7177171
考题
请读程序: includeChar fun(char*c)(if(c='A') * c-='A'-'a'ret
请读程序: # 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 dOORB.ope the doorC.OPEN THE DOORD.Open The Door
考题
下面程序的输出是______。 fun(char *s,int p1,int p2) { char c; while(p1<p2) { c=s[p1];s[p1]=s[p2];s[p2]=c;p1++;p2--;} } main() { char a[]="ABCDEFG",k,*p; fun(a,0,2);fun(a,4,6); printf("%s\n ",a); }A.ABCDEFGB.DEFGABCC.GFEDCBAD.CBADGFE
考题
以下程序运行后,输出结果是()includess(char*s){char*p=s; while(*p)p++ return(p-s);
以下程序运行后,输出结果是( ) #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.8B.7C.6D.5
考题
以下程序运行后的输出结果是______。 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.8B.7C.6D.5
考题
有以下程序:include using namespace std;int main ( ){ char s1[10],s2[10]; char*p
有以下程序: #include <iostream> using namespace std; int main ( ) { char s1[10],s2[10]; char *p=s1,*q=s2; cin>>s1>>s2; while (*p ! =' \0 ' ) p++; while (*q!='\0') *p++=*q++; *p='\0'; cout<<s1<<end1; return 0; }A.abcd0ghijB.abcd0ghij0C.abcdD.abcdghij
考题
设有如下函数定义,则输出结果为_______。 char*fun(char*str) { char*p=str; while(*p) {if(*p>'d')continue; p++; } return p; } main() { printf("%s\n",fun("welcome!")); }A.welcomeB.come!C.wD.程序进入死循环
考题
有以下程序:includeint fun(char s[]){ intn=0;while(*s='0'){n=10
有以下程序: #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.9B.61490C.61D.5
考题
下面程序输出的结果是()。includemain(){char *a="1234";fun(a);printf("\n");}fun(cha
下面程序输出的结果是( )。 #include<stdio.h> main() { char *a="1234"; fun(a); printf("\n"); } fun(char *s) { char t; if(*s) { t=*S++;fun(s);} else return; if(t!='\0') putchar(t); }A.1234B.4321C.1324D.4231
考题
下面程序的运行结果是______。 include include fun(char*w,int n) { char
下面程序的运行结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) {t=*s1++;*s1=*s2--;*s2=t;} } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }A.7654321B.1714171C.1711717D.7177171
考题
下列程序的运行结果是()。 #include #include FUN(char *w,int n) { char temp,*s1,*s2; s1=w; s2=w+n-1; while(s1temp=*s1++; *s1=*s2--; *s2=temp; } } main( ) { char *p; p=“1234567”; FUN(p,strlen(p)); puts(p); }
考题
填空题下列程序的运行结果是()。 #include #include FUN(char *w,int n) { char temp,*s1,*s2; s1=w; s2=w+n-1; while(s1temp=*s1++; *s1=*s2--; *s2=temp; } } main( ) { char *p; p=“1234567”; FUN(p,strlen(p)); puts(p); }
考题
单选题有以下程序
#include
charfun(char*c)
{
if(*c='Z'*c='A')
*c-='A'-'a';
return*c;
}
main()
{
chars[81],*p=s;
gets(s);
while(*p)
{
*p=fun(p);
putchar(*p);
p++;
}
printf();
}
若运行时从键盘上输入OPENTHEDOOR回车,程序的输出结果是( )。A
OPEN THE DOORB
OPEN tHE dOORC
open the doorD
Open The Door
考题
单选题有以下程序:
#include
intfun(char*s)
{
char*p=s;
while(*p++!='\0');
return(p-s);
}
main()
{
char*p=01234;
printf(%d,fun(p));
}
程序的运行结果是( )。A
6B
5C
4D
3
热门标签
最新试卷