有以下程序 main ( ) { char str[] ="xyz", *ps=str; while (*ps) ps++: for (ps-- ;ps-str>=0 ;ps--) puts(ps); } 执行后输出结果是A.yz xyzB.z yzC.z yz xyzD.x xy xyz

有以下程序 main ( ) { char str[] ="xyz", *ps=str; while (*ps) ps++: for (ps-- ;ps-str>=0 ;ps--) puts(ps); } 执行后输出结果是

A.yz xyz

B.z yz

C.z yz xyz

D.x xy xyz


相关考题:

有以下程序main(){ char s[]={"aeiou"},*ps;ps=s; printf("%c\n",*ps+4);}程序运行后的输出结果是A)aB)eC)uD) 元素 s[4] 的地址

以下程序运行后,intfunc(char*str){intnum=0;while(*(str+num)!=\0)num++;return(num);}main(){charstr[10],*p=str;gets(p);printf(“%d\n“,func(p));}如果从键盘上输入ABCDE回车,则输出结果为() A、8B、7C、6D、5

表达式0x13while(*(str+num)!=\0)num++;return(num);}main(){charstr[10],*p=str;gets(p);printf(“%d\n“,func(p));}如果从键盘上输入ABCDE回车,则输出结果为() A、8B、7C、6D、5

当运行以下程序时,输入 abcd ,程序的输出结果是 : 【 9 】 。insert(char str[]){ int i;i=strlen(str);while(i0){ str[2*i]=str[i];str[2*i-1]='*'; i--;}printf(" % s\n",str);}main(){ char str[40];scanf(" % s",str);insert(str);}

有以下程序 main() { char s[]="Yse\n/No",*ps=s; puts(ps+4); *(ps+4)=0; puts(s); } 程序运行后的输出结果是(选项D中的第一行是空行)A.n/No Yes /NoB./No YesC.n/No yes /NoD./No Yes

有以下程序 main() {char s[]={"aeiou"},*ps; ps=s; printf("%c\n",*ps+4); } 程序运行后输出的结果是______。A.aB.eC.uD.元素s[4]的地址

有以下程序 main( ) { char str[ ]="xyz",*ps=str; while(*ps) ps++; for(ps--;ps-str>=0;ps--) puts(ps);} 执行后输出结果是A.yz xyzB.z yzC.z yz xyzD.x xy xyz

有以下程序: main() { char str[]="xyz",*ps=str; while(*ps) ps++; for(ps--;ps-str>=0;ps--) puts(ps); } 执行后输出结果是( )。A.yz xyZB.z yzC.z yzD.x xy xyz xyz

有以下程序:includemain(){charstr[][20]={"Hello","Beijing"}*p=str;printf("%\n",s 有以下程序: #include <string.h> main() { char str[][20]={"Hello","Beijing"}*p=str; printf("%\n",strlen(p+20)); } 程序运行后的输出结果是A.0B.5C.7D.20

以下程序includeincludemain(){ char*pl="abc",*p2="ABC",str[50]="xyz";s 以下程序 #include<stdio.h> #include<string.h> main() { char*pl="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2.strcat(p1,p2)); printf("%s\n,str); } 的输出是______。A.xyzabcABCB.zabcABCC.yzabcABCD.xyabcABC

有以下程序:include main( ){chars[] ="Yes\n/No",*ps=s;puts(ps +4); * (pa +4) =0;p 有以下程序: #include <stdio.h> main( ) { chars[] ="Yes\n/No",*ps=s; puts(ps +4); * (pa +4) =0; puts(s); }程序运行后的输出结果是( )。A.n/No Yes /NoB./No YesC./NO Yes /NoD.n/No Yes

有以下程序: main() { char s[]="Yes\n/No",*ps=s; puts(ps+4); *(ps+4)=0; puts(s); } 程序运行后的输出结果是(选项D中的第一行是空行) ( )。A.n/No Yes /NoB./No YesC./No Yes /NoD./No Yes

阅读下列程序,写出程序的运行结果【】。 include void main() { charstr1[ ]: "Hello, 阅读下列程序,写出程序的运行结果【 】。include<iostream. h>void main() { char str1[ ]: "Hello, World?;char str2[100];int i=0;do{if (str1[i]>= 'a' str1[i]<= 'z' )str2[i]=str1[i]-32;elsestr2[i]=strl [i];i++;}while(strl[i]!='\0');str2[i]='\0';cout<<str1<<end1;cout<<str2<<end1;}

有以下程序: main() { char str[]="xyz", *ps=str; while(*ps) ps++; for(ps--;ps-str>=O;ps--) puts(ps); } 执行后的输出结果是( )。A.yz xyzB.z yzC.z yz xyzD.x xy xyz

有以下程序main(){ char str[]="xyz",*ps=str; while(*ps) ps++; for(ps--; ps-str>=0; ps--) puts(ps);} 程序的运行结果是A.yz B.z C.z D.x xyz yz yz xy xyz xyz

若有以下程序: #include 〈iostream〉 using namespace std; class sample { private: int i; public: void setvalue(int m) { i=m; } void fun(int m) { i+=m; } void disp() { cout〈〈i〈〈end1; } }; int main() { sample *ps; ps=new sample; ps-setvalue(20); ps-fun(5); ps-disp(); return 0; } 程序运行后,输出的结果是( )。A.15B.20C.25D.30

下列程序中,正确的为______。A.main() { int *pb=b; float 1>=15.25; print f("%d\n" ,*pb); }B.amin() { int a,*pa; a=10; *pa=a; prinffC%d",*pa); }C.main() { char s[20]; char *ps=s; scanf("%s",*p); printf("%s",*p); }D.main() { char str[10]; int *ps=str[0]; str="abcdefg"; printf("%s",*p); }

若有以下程序:includeusingnamespaceStd;classsample{ inti;publiC: sample(){} void 若有以下程序: #include <iostream> using namespace Std; class sample { int i; publiC: sample(){} void setvalue(int m) { i=m; } void fun(int m) { i+=m; } void disp() { cout<<i<<end1; } }; int main() { sample *ps; ps=new sample; ps->setvalue(20); ps->fun(5); ps->disp(); return 0; } 程序运行后,输出的结果是( )。A.15B.20C.25D.30

有以下程序 main() { char atr[]="xyz",*ps=str; while(*ps)ps++; for(ps--;ps-str>=0;ps--) puts(ps); } 执行后输出结果是A.yz xyzB.x yzC.z yz xyzD.x xy xyz

以下程序运行后的输出结果是( ) main() { char s[]="1234", *ps; for(ps=s;ps<s+3;ps++)printf("%c",ps); printf("\n"); }A.123B.112123C.1234D.乱码

当运行以下程序时,输入abcd,程序的输出结果是:( )。insert(char str[]){int i;i=strlen(str);while(i>0){str[2*i]=str[i];str[2*i-1]='*';i--;}printf("%s\n",str);}main(){char str[40];scanf("%s",str);insert(str);}

若有定义:charstr1[6]="abcdm",*ps,*str2="abcdef";则()是正确的A、strcpy(str1,str2)B、表达式strcmp(str1,str2)的值大于0C、str1=str2D、表达式strlen(str1)的值为6

问答题请根据以下各小题的要求设计C应用程序(包括界面和代码)。  请补充main函数,该函数的功能是:先以只写方式打开文件“out52.dat”,再把字符串str中的字符保存到这个磁盘文件中。  注意:部分源程序给出如下。  请勿改动主函数main和其他函数中的任何内容,仅在main函数的横线上填入所编写的若干表达式或语句。  试题程序如下:#include#defineN80main(){ FILE*fp; inti=0; charch; charstr[N]=I'mastudent!; if((fp=fopen(①______))==NULL) {  printf(cannotopenout52.dat);  exit(0); } while(str[i]) {  ch=str[i];  ②______;  putchar(ch);  i++; } ③______;}

单选题以下使指针指向一个字符串的选项错误的是(  )。Achar str[]=string; char * ps; *ps= str;Bchar str[]=string; char *ps; ps= str;Cchar str[]=strinh,* ps=str;Dchar * ps; ps=str; ps=strinh;

单选题有如下程序:#include int disp(char *str){ while(*str) putchar(*str++); return *str;}main(){ printf(%d,disp(NAME));}程序运行后的输出结果是(  )。ANAME0BNAMEECNAMEDNAME\0

单选题若有定义:charstr1[6]="abcdm",*ps,*str2="abcdef";则()是正确的Astrcpy(str1,str2)B表达式strcmp(str1,str2)的值大于0Cstr1=str2D表达式strlen(str1)的值为6

单选题有以下程序:#include int disp(char *str){ while(*str) putchar(*str++); putchar('#'); return *str;}main(){ printf(%d,disp(C##123));}程序运行后的输出结果是(  )。AC##123#0BC##1230CC##0DC##123#\0

单选题有以下程序:#include main(){ char s[10] = verygood, *ps = s; ps += 4; ps = nice; puts(s);}程序的运行结果是(  )。AniceBveryniceCnicegoodDverygood