有以下程序
#include <stdio.h>
int fun(char s[ ])
{ int n=0;
while(*s<='9'&&*s>='0') {n=10*n+*s-'0';s++;}
retum(n);
}
main( )
{ char s[10]={'6','1','*','4','*','9','*','0','*'};
printf("%d\n",fun(s));
}
程序的运行结果是
A.9
B.61490
C.61
D.5
第1题:
有以下程序: #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.9
B.61490
C.61
D.5
第2题:
有以下程序 #include <stdio.h> void fun(int *s,int n1,int n2) { int i,j,t; i=n1 j=n2; while(i<j) {t=s[i];s[i]=s[j];s[j]=t;i++;j--;} } main() { int a[10]={1,2,3,4,5,6,7,8,9,0},k; fun(a,0,3); fun(a,4,9); fun(a,0,9); for(k=0;k<10;k++)printf("%d",a[k]); printf("\n"); } 程序的运行结果是
A.987654321
B.4321098765
C.5678901234
D.987651234
第3题:
有以下程序
#include <stdio.h>
void fun(char *t,char *s)
{ while(*t!=0) t++;
while((*t++=*s++)!=0);
}
main( )
{ char ss[10]="acc",aa[10]="bbxxyy";
fun(ss,aa); printf("%s,%s\n",ss,aa);
}
程序的运行结果是
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
第4题:
有下列程序: #include <stdio.h> void fun(int * s,int n1,int n2) { int i,j,t; i=n1;j=n2; while(i<j){t=s[i];s[i]=s[j];s[j]=t;i++;j--;} } main() { int a[10]={1,2,3,4,5,6,7,8,9,0},k; fun(a,0,3); fun(a,4,9);fun(a,0,9); for(k=0;k<10;k++)printf("%d",a[k]);printf("\n"); } 程序的运行结果是( )。
A.987654321
B.4321098765
C.5678901234
D.987651234
第5题:
有以下程序 #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.9
B.61490
C.61
D.5
第6题:
有以下程序 #include <stdio.h> void fun(char *t, char *s) { while(*t!=0) t++; while( (*t++ = *s++ )!=0 ); main() { char ss[10]="acc",aa[10]="bbxxyy"; fun(ss, aa); printff"%s,%s\n", ss,aa); 程序的运行结果是
A.accxyy, bbxxyy
B.acc, bbxxyy
C.accxxyy, bbxxyy
D.accbbxxyy, bbxxyy
第7题:
有以下程序 #include <stdio.h> int fun(char s[]) { int n=O; 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.9
B.61490
C.61
D.5
第8题:
有以下程序 #include <stdio.h> voidfun(char*t,char*s) {while(*t!=0) t++; while((*t++=*s++)!=0); } main() {char ss[10]="acc",aa[10]="bbxxyy"; fun(ss,aa); printf("%s,%s\n",ss,aa); } 程序的运行结果是
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
第9题:
有以下程序 #inclUde <stdio.h> void fun(int *s,int n1,int n2) { int i,j,t; i=n1; j=n2; while(i<j) {t=s[i];s[i]=s[j];s[j]=t;i++;j--;} } main() { int a[10]={1,2,3,4,5,6,7,8,9,0},k; fun(a,0,3); fun(a,4
A.0987654321
B.4321098765
C.5678901234
D.0987651234