单选题程序段 chara[]=“abdcacdef”; char*p=a;intn=0; while(*p!=‘/0’){n++;p++;}结果中,n的值是()A6B8C7D9

单选题
程序段 chara[]=“abdcacdef”; char*p=a;intn=0; while(*p!=‘/0’){n++;p++;}结果中,n的值是()
A

6

B

8

C

7

D

9


参考解析

解析: 暂无解析

相关考题:

以下与库函数strcpy(char *p, char *q)功能不相等的程序段是()。 A.strcpy1(char *p, char *q){ while ((*p++=*q++)!='\0')}B.strcpy2( char *p, char *q){ while((*p=*q)!='\0'){p++ q++}}C.strcpy3(char*p, char *q){ while (*p++=*q++)}D.strcpy4(char *p, char *q){ while(*p)*p++=*q++}

有以下程序void fun1(char *p){ char *q;q=p;while(*q!='\0'){ (*q)++; q++; ) }}main(){ char a[]={"Program"),*p;p=a[3];fun1(p);printf(" % s\n",a);}程序执行后的输出结果是A)ProhsbnB)PrphsbnC)ProgsbnD)Program

有以下程序: void fun1(char*p) {char*q; q=P; while(*q!='\0') { (*q)++;q++;} } main() {char a[]={"Program"),*p; p=&a[3];funl(p);printf("%s\n",A); } 程序执行后的输出结果是( )。A.ProhsbnB.PrphsbnC.ProgsbnD.Program

下列程序段的输出结果为()。includemain(){static char a[]="language";char*p;p=a;for 下列程序段的输出结果为( )。 #include<stdio.h> main() { static char a[]="language"; char*p; p=a; for(p=a;p<a+8;p+=2) putchar(*p); }A.1B.4C.9D.0

下列程序的输出结果是()。includeusing namespace std;int main()于chara[]=”Hello,Te 下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() 于 chara[]=”Hello,Test”; Char*p=a; while(*p) { if(*p)=’a’*p(=’z’) cout<<char(*p+’A’-’a’); else cout<<*p; p++; } return 0; }A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST

有以下程序,其中函数f的功能是将多个字符串按字典顺序排序#includestring.hvoidf(char*p[],intn){char*t;inti,j;for(i=0;in-1;i++)for(j=i+1;jn;j++)if(strcmp(p[i],p[j])0){t=p[i];p[i]=p[j];p[j]=t;}}main(){char*p[5]={“abc”,“aabdfg”,“abbd”,“dcdbe”,“cd”}。:A.2B.3C.6D.4

下列程序的输出结果是______。 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

以下程序运行后的输出结果是【】include main ( ) {char a[] ="123456789", *p;int i =0; 以下程序运行后的输出结果是【 】include <stdio.h>main ( ){ char a[] ="123456789", *p;int i =0;p=a;while( * p){ if(i%2 ==0) *p='*';p++;i++;}puts(a);}

下面程序的运行结果是includemain(){int a=28,b;char s[10],*p;p=s;do{b=a%16;if(b 下面程序的运行结果是 #include<stdio.h> main() {int a=28,b; char s[10],*p; p=s; do{b=a%16; if(b<10) *p=b+48; else*p=b+55; p++;a=a/5;}while(a>0); *p='\0';puts(s);}A.10B.C2C.C51D.\0

有以下程序: include void funl (char * p){char * q; q=p; while( *q! ='\0') } (*q) 有以下程序: #include <stdio.h>void funl (char * p){ char * q; q=p; while( *q! ='\0') } (*q) ++;q++;}mains( ){ char a[ ] = { "Program" } , * p; p = a[3]; fun1 (p); printf("% s \n" ,a);}程序执行后的输出结果是( )。A.ProhsbnB.PrphsbnC.ProgsbnD.Program

有以下程序:include main( ) char * p[ ] = {"3697" ,"2548" }; int i,j;long num =0 有以下程序: #include <stdio.h> main( ) char * p[ ] = {"3697" ,"2548" }; int i,j; long num =0; for(i =0;i<2;i ++ ) { j =0; while(p[i][j]! ='\0') { if((p[i][j]-'0')%2) num=10*num+p[i][j]-'0'; j+ =2; } printf( "%d \n" ,num);}程序执行后的输出结果是( )。A.35B.37C.39D.3975

下面程序的运行结果是( )。 include main() {char a[80],*p="AbabCDcd"; int i=0,j=0; w 下面程序的运行结果是( )。 include<stdio.h> main() {char a[80],*p="AbabCDcd"; int i=0,j=0; while(*(p++)!='\0') {if(*p>='a'*p<='z'){a[i]=*p;i++;} } a[i]='\0'; puts(A); }

若有定义:char*st="how are you";,下列程序段中正确的是A.chara[11],*p;strcpy(p=a+1,st[4]);B.chara[11];strcpy(++a,st);C.chara[11];strcpy(a,st);D.chara[],*p;strcpy(p=a[1],st+2);

有以下程序includeintfun(chars[]){intn=0;while(*s='0'){n=10*n+* 有以下程序 #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

下列程序的执行结果是______。 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

下列程序的输出结果是()。includeusing namespace std;int main(){char a[]="Hello,Te 下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]="Hello,Test"; char *p=a; while(*p) { if(*p>='a'*p<='’z') cout<<char(*p+'A'-'a'); else cout<<*p; p++; } return 0; }A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST

请读程序: 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

下列程序的输出结果是( )。 #includediostream usingnamespacestd; intmain() { chara[]="Hell0,Test"; char*p=a; while(*p) { if(*p=a&&*p=z) coutchar(*p+A-a); elsecout*P; p++; } return0; }A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST

以下程序段运行后*(p+3)的值为()char a[]=”good”;char *p;p=a; A.‘d’B.‘\0’C.存放’d’的地址D.‘0’

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

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

有以下程序 includestdio.hintfun(chars[]){intn=0;while(*s=’9’stdio.hint 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

程序段 chara[]=“abdcacdef”; char*p=a;intn=0; while(*p!=‘/0’){n++;p++;}结果中,n的值是()A、6B、8C、7D、9

设已有定义:char*st=”howareyou”;下列程序段中正确的是()。A、chara[11],*p;strcpy(p=a+1,st[4]);B、chara[11];strcpy(++a,st);C、chara[11];strcpy(a,st);D、chara[],*p;strcpy(p=a[1],st+2)

以下与库函数strcpy(char*p1,char*p2)功能不相等的程序段是()A、strcpyl(char*p1,char*p2){while((p1++=p2++)!=’/0’);}B、strcpy2(char*pl,char*p2){while((*p1=*p2)!=’/0’)pl++,p2++;}C、strcpy3(char*pl,char*p2){while((*p1++=*p2++);)D、strcpy4(char*p1,char*p2){whi1e(*p2)*pl++=*p2++;}

以下程序段运行后*(p+3)的值为() char a[]=”good”; char *p; p=a; A、‘d’B、‘/0’C、存放’d’的地址D、‘0’

单选题以下程序段运行后*(p+3)的值为() char a[]=”good”; char *p; p=a;A‘d’B‘/0’C存放’d’的地址D‘0’