下列程序的输出结果是 #include void main( ) { char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) { case'1':x4++; case'2':x3++; case'3':x2++; case'4':x1++; } cout < < x1 < < "," < < x2A.8,6,4,1B.8,6,3,2C.8,8,4,1D.8,6,4,2
下列程序的输出结果是 #include void main( ) { char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) { case'1':x4++; case'2':x3++; case'3':x2++; case'4':x1++; } cout < < x1 < < "," < < x2
A.8,6,4,1
B.8,6,3,2
C.8,8,4,1
D.8,6,4,2
相关考题:
有以下程序fun(char p[][10]){ int n=0,i;for(i=0;i7;i++)if(p[i][0]=='T')n++;return n;}main(){ char str[][10]={"Mon","Tue","Wed","Thu","Fri","Sat","Sun"};printf(" % d\n",fun(str));}程序执行后的输出结果是A)1B)2C)3D)0
下列程序的运行结果为includevoid abc(char*str){int a,b;for(a=b=0;str[a]!='\0';a++ 下列程序的运行结果为 #include<stdio.h> void abc(char*str) { int a,b; for(a=b=0;str[a]!='\0';a++) if(str[a]!='c') str[b++]=str[a]; str[b]='\0';} void main() { char str[]="abcdef"; abc(str); printf("str[])=%s",str);}A.str[]=abdefB.str[]=abcdefC.str[]=aD.str[]=ab
下面程序的运行结果是()。includevoid del(char*s){int i,j;char *a;a=s;for(i=0,j=0;a 下面程序的运行结果是( )。 #include<stdio.h> void del(char*s) { int i,j; char *a; a=s; for(i=0,j=0;a[i]!='\0';i++) { if(a[i]>='0'a[i]<='9') { s[j]=a[i]; j++; } s[j]='\0'; }} main() {char s[]="aa89gggh"; del(s); printf("\n%s",s); }A.aaB.89C.ggghD.aa89gggh
下面程序的运行结果是includevoid delch(char*s){int i,j;char *a;a=S;for(i=0,j=0;a[ 下面程序的运行结果是 #include<stdio.h> void delch(char *s) { int i,j; char *a; a=S; for(i=0,j=0;a[i]!='\0';i++) if(a[i]>='0' aa[i]<='9') {s[j]=a[i]; j++;} s[j]='\0';} main() { char *item="a34bC"; delch(item); printf("\A.abcB.34C.a34D.a34bc
下列程序的输出结果是()。includevoid main(){char*str=”12123434”;int x1=0,x2=0,x 下列程序的输出结果是( )。 #include<iostream.h> void main() {char*str=”12123434”; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=’\0’;i++) switch(str[i]) {case’1’:x4++; case’2’:x3++; case’3’:x2++; case’4’:xl++; ) cout<<xl<<“,”<<x2<<A.8,6,4,1B.8,6,3,2C.8,8,4,lD.8,6,4,2
有如下程序: include using namespace std; int main() { char st 有如下程序: #include <iostream> using namespace std; int main() { char str[100], *p; cout<<"Please input a string:"; cin>>str; p=str; for (int i=0; *p!='\0'; p++,i++); cout<<i<<endl; return 0; }运行这个程序时,若输入字符串为 abcdefgabcd则输出结果是A.7B.12C.13D.100
下列程序的输出结果是( )。includeiostream.hvoidmain() (char*str=12123434iostream.hvoidmain()(char*str=12123434;intx1=0,x2=0,x3=0,x4=0,i;for(i=0;str[i]!=\0;i++)switch(str[i]){case1:x4++;case2:x3++;case3:x2++;case4:x1++;}coutx1,x2:,x3,x4;}A.8,6,4,1B.8,6,3,2C.8,8,4,1D.8,6.4,2
以下程序运行后的输出结果是【】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);}
下列程序的输出结果是( )。#includeiostream.h voidmain() (char*str="12123434"; intx1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=\0;i++) switch(str[i]) {case1:x4++; case2:x3++; case3:x2++; case4:x1++; } coutx1","x2:","x3 ","x4; }A.8,6,4,1B.8,6,3,2C.8,8,4,1D.8,6.4,2
下列程序的运行结果为()。includevoid abc(char*str){int a,b,i,j; for(i=j=0;str[i]!= 下列程序的运行结果为( )。 #include<stdio.h> void abc(char*str) { int a,b,i,j; for(i=j=0;str[i]!='\0';i++) if(str[i]!='a' str[j++]=str[i]; str[j]='\0'; } void main() { char str[]="abcdef"; abc(str); printf("str[]=%s",str); }A.str[]=bcdefB.str[]=abcdefC.str[]=aD.str[]=ab
以下程序运行后的输出结果是()。includevoid main(){ char aft="abbcabbcabbc"; int 以下程序运行后的输出结果是( )。 #include<iostream.h> void main() { char aft="abbcabbcabbc"; int i=0,j=0,k=0; while(a[i]) { if(a[i]=='a') j++; if(a[i]=='b') k++; i++; } cout<<j<<""<<k<<end1; }A. 2,6B.3,5C.4,7D.3,6
如下程序:includevoid main(){char str[2][5]={"1234","5678"),*p[2];int i,j,s=0; 如下程序: #include<iostream.h> void main() { char str[2][5]={"1234","5678"),*p[2]; int i,j,s=0; for(i=0;i<2;i++)p[i]=str[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>'\0';j+=2) s=10*s+p[i][j]-'0'; cout<<s; } 该程序的输出结果是( )。A.1357B.2468C.3556D.23678
下列程序的输出结果是______。 includevoid main( ){ char a[]="abcdabcabfgacd"; in 下列程序的输出结果是______。include<iostream.h>void main( ){char a[]="abcdabcabfgacd";int i1=0,i2=0,i=0;while(a[i]){if(a[i]=="a")i1++;if(a[i]=="b")i2++;i++;}cout<<i1<<""<<i2<<endl;}
以下程序运行后输入:3,abcde回车,则输出结果是【 】include move(char *str, 以下程序运行后输入:3,abcde回车,则输出结果是【 】include <string.h>move(char *str, int n){ char temp; int i;temp=str[n-1];for(i=n-1;i>0;i--) str[i]=str[i-1];str[0]=temp;}main( ){ char s[50]; int n, i, z;scanf("%d,%s",n,s);z=strlen(s);for(i=1; i<=n; i++) move(s, z);printf("%s\n",s);}
下列程序的输出结果是______。 char*fun(char*str,int n) { int i; char*p=str; for(i=0;i<10;i++,str++) *str='a'+i; return++p; } main() { char a[10]; printf("%s\n",fun(a,10)); }A.ABCDEFGHIJB.abcdefghijC.bcdefghijD.不确定的值
下列程序的输出结果是includevoid main( ){char*str="12123434";int xl=0,x2=0,x3= 下列程序的输出结果是 #include<iostream.h> void main( ) {char*str="12123434"; int xl=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) {case'1':x4++; case'2':x3++; case'3':x2++; case'4':x1++; } cout<<x1<<","<<x2<<","<<x3<<","<<x4; }A.8,6,4,1B.8,6,3,2C.8,8,4,1D.8,6,4,2
有如下程序includevoid main(){char ch[2][5]={"6937","8254"},*p[2];int i,j,s=0; 有如下程序 #include<iostream.h> void main() {char ch[2][5]={"6937","8254"},*p[2]; int i,j,s=0; for(i=0;i<2;i++)p[i]=ch[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>'\0';j+=2) s=10*s+p[i][j]-'0'; cout<<s; return 0; } 该程序的输出结果是( )。A.69825B.63825C.6385D.693825
有以下程序:include fun( char p[] [10]){int n=0,i; for(i=0;i 有以下程序:#include <stdio.h>fun( char p[] [10]){ int n=0,i; for(i=0;i<7;i ++) if(p[i][0] =='T') n++; return n;}main( ){ char sir[] [10] = { "Mon" ,"Tue" ,"Wed" ,"Thu" ,"Fri" ,"Sat" ,"Sun" }; prlnff(" % d\n" ,fun(str) );}程序执行后的输出结果是( )。A.1B.2C.3D.0
有以下程序includevoid main(){char s[]={"01aXy"};int i,n=0;for(i=0;s[i]!=0;i++)if 有以下程序 #include<stdio.h> void main() { char s[]={"01aXy"};int i,n=0; for(i=0;s[i]!=0;i++) if(s[i]<='a's[i]>='z')n++; printf("%d\n",n); } 程序运行后的输出结果是( )。A.0B.2C.3D.5
下列程序的输出结果是includevoid main(){char*str="12123434"; int x1=0,x2=0,x3= 下列程序的输出结果是 #include<iostream.h> void main() { char*str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=‘\0’;i++) switch(str[i]) { case'l':x4++; case'2':X3++; case'3':x2++; case'4':X1++; } cout << X1 << " ," << x2 << " ’" << x3 << " ," << X4; }A.8,6,4,1B.8,6,3,2C.8,8,4,1D.8,6,4,2
有以下程序: fun(char p[][10]) { int n=0,i; for(i=0;i<7;i++) if(P[i][0]=='T')n++; return n; } main() {char str[][10]={"Mon","Tue","wed","Thu","Fri","Sat","Sun"}; printf("%d\n",fun(str)); } 程序执行后的输出结果是( )。A.1B.2C.3D.0
阅读下列程序,当运行程序时,输入asd af aa z67,则输出为()。includeint fun (char *str 阅读下列程序,当运行程序时,输入asd af aa z67,则输出为( )。 #include <sldio.h> int fun (char *str) { int i,j=0; for(i=0;str[i]! ='\0';i++) if(str[i]! =") str[j++]=str[i]; str[j]='\0'; } main() { char str[81]; int n; printf("Input a string:"); gets(str); fun(str); printf("%s\n",str); }A.asdafaaz67B.asd af aa z67C.asdD.z67
下列程序的输出结果是includevoid main(){char*str="12123434";int x1=0,x2=0,x3=0 下列程序的输出结果是 #include<iostream.h> void main() {char*str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) {case'1':x4++; case'2':X3++; case'3':X2++; case'4':X1++; } cout<<X1<<","<A.8,6,4,1B.8,6,3,2C.8,8,4,1D.8,6,4,2
下面程序的运行结果是()。includevoid delch(char *s){ int i,j;char*a;a=s;for(i=0,j= 下面程序的运行结果是( )。 #include<stdio.h> void delch(char *s) { int i,j; char*a; a=s; for(i=0,j=0;a[i]!='\0' ;i++) if(a[i]>='0' a[i]<='9') { s[j]=a[i]; j++;} s[j]='\0'; } main() { char*item="a34bc"; delch(item); printf("\n%s" ,item);}A.abcB.34C.a34D.a34bc
下列程序的输出结果是______。 include int CalcDigital(char*str) { if(str= =NULL) 下列程序的输出结果是______。include<iostream.h>int CalcDigital(char*str){if(str= =NULL)return 0;int num_of_digital=0;for(int i=0;str{i]!=0x0;i++)if(str[i]<='9' str[i]>='0')num_of_digital++;return num_of_digital;}void main( ){char a[]="Beijing20080lympic";cout<<CalcDigital(a)<<endl;}
下列程序的输出结果是 ()。 #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 #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); }