网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

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

A.yz xyz

B.x yz

C.z yz xyz

D.x xy xyz


参考答案

更多 “ 有以下程序 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[]={"aeiou"},*ps;ps=s; printf("%c\n",*ps+4);}程序运行后的输出结果是A)aB)eC)uD) 元素 s[4] 的地址

考题 有以下结构体说明、变量定义和赋值语句struct STD{ char name[10];int age;char sex;} s[5],*ps;ps=s[0];则以下 scanf 函数调用语句中错误引用结构体变量成员的是A)scanf("%s",s[0].name);B)scanf("%d",s[0].age);C)scanf("%c",(ps-sex));D)scanf("%d",ps-age);

考题 编写一个函数,从传入的num个字符中找出最长的一个字符串,并通过形参指针max传回该串地址(用****作为结束输入的标志)。注意:部分源程序给出如下.请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。试题程序:include<conio.h>include<stdio.h>include<string.h>fun(char (*a) [81], int num, char *max){}main (){char ss[l0] [81],*ps;int n, i=0;clrscr();prlntf("输入若干个字符串");gets(ss[i]);puts(ss[i]);while(!strcmp(ss[i], "****")==0)/*用****作为结束输入的标志*/{i++;gets(ss[i]);puts(ss[i]);}n=i;ps=fun(ss,n,ps);print~("\nmax=%s\n",ps);}

考题 有以下程序 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]的地址

考题 有以下结构体说明、变量定义和赋值语句 struct STD { char name[10]; int age; char sex; }s[5],*ps; ps=s[0]; 则以下scanf函数调用语句中错误引用结构体变量成员的是______。A.scanf("%s",s[0].name);B.scanf("%d",s[0].age);C.scanf("%c",(ps->sex));D.scanf("%d",ps->age);

考题 有以下程序 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

考题 请编写一个函数int stringLen(char*ps),该函数能计算出字符串ps的长度,函数返回值就是字符串的长度(不包括字符串结束标识号'\0')。本题要求:用指针方式及循环来实现该函数。注意;部分源程序已存在考生文件夹下的文件PROC6,cpp中。请勿修改主函数和其他函数中的任何内容,仅在函数stringLen()的花括号中填写若干语句。文件PROC6.cpp的内容如下://PROC6.cppinclude<iostream>using namespace std;int stringLen(char *);int main(){char str[100],*p;cout<<"Input your string please!\n";cin>>str;p=str;cout<<"The lenth of your string is "<<stringLen(p)<<end1;return 0;}int stringLen(char *ps){// * * * * *}

考题 若指针ps已正确定义,要使ps指向能够存储8个字符的动态存储单元,以下不正确的语句是( )A.ps=(char*)malloc(8);B.ps=(char *)malloc(sizeof(char)* 8);C.ps=(char*)calloc(8,sizeof(char))D.ps=8*(char*)malloc(sizeof(char))

考题 有以下程序: 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

考题 若有以下定义,则不能代表字符。的表达式是______。 char s[20]="programming",*ps=s;A.ps+2B.s[2]C.ps[2]D.ps+=2,*ps

考题 以下程序的输出结果是【 】。includeincludechar*fun(char*0{ char *p--t;retur 以下程序的输出结果是【 】。include <stdio.h>include <string.h>char *fun(char *0{ char *p--t;return (p+strlen(t)/2);}main(){ char *str="abcdefgh";str=ftm(str);puts(str);}

考题 有以下程序: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

考题 有以下程序: 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 s[]="1234", *ps; for(ps=s;ps<s+3;ps++)printf("%c",ps); printf("\n"); }A.123B.112123C.1234D.乱码

考题 下列程序的输出结果是 ()。 #include  #include   main( ) {    int i=0;    char str1[10]=“1234”, str2[10]= “567”;    strcat(str1,str2);    while(str2[i++]!=‘/0’)     str2[i]=str1[i];    puts(str2);   }

考题 单选题以下使指针指向一个字符串的选项错误的是(  )。A char str[]=string; char * ps; *ps= str;B char str[]=string; char *ps; ps= str;C char str[]=strinh,* ps=str;D char * ps; ps=str; ps=strinh;

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

考题 填空题下列程序的输出结果是 ()。 #include  #include   main( ) {    int i=0;    char str1[10]=“1234”, str2[10]= “567”;    strcat(str1,str2);    while(str2[i++]!=‘/0’)     str2[i]=str1[i];    puts(str2);   }

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

考题 单选题有以下函数: intfun(char*ps) {  char*p;  p=ps;  if(*ps==NULL)return0;  while(*++p);  return(p-ps); } 该函数的功能是(  )。A 计算字符串的长度B 实现字符串的赋值C 将字符串逆序存放D 计算字符串所占字节数

考题 单选题有以下程序: #include main() {  ints[3][2]={1,2,3,4,5,6},*ps[3],k;  for(k=0;k3;k++)  {   ps[k]=s[k];   printf("%d",*(ps[k]+1));  } } 程序的运行结果是(  )。A 246B 135C 123D 456