有以下程序#include <stdio.h>void fun(int s[]){ static int j=0; do s[j]+=s[j+1]; while(++j<2);}main(){ int k,a[10]={1,2,3,4,5}; for(k=1;k<3;k++) fun(a); for(k=0;k<5;k++) printf("%d",a[k]);}程序的运行结果是A.34756 B.23445C.35745 D.12345
第1题:
请读程序: # include<stdio.h> void fun(int * s) { static int j=0; do s[j]+=s[j+1] while( + + j<2); } main( ) { int k,a[10]={l,2,3,4,5}; for(k=l;k<3;k+ +)fun(a); for(k=0;k<5;k++)prinf("%d",a[k]); } 上面程序的输出结果是 ( )
A.34756
B.23445
C.35745
D.12345
第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(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
第4题:
请阅读以下程序: #include<stdio.h> void fun(int s[]) { static int j=0; do s[j]+=s[j+1]; while(++j<2);} main() { int k,a[10]={1,2,3,4,5}; for(k=1;k<3;k++)fun(a); for(k=0;k<5;k++)printf("%d",a[k]);} 上面程序的输出是
A.34756
B.23445
C.35745
D.12345
第5题:
有以下程序
#include<stdio.h>
void fun(int *s)
{ static int j=0;
do { s[j]=s[j]+s[j+1]; )while(++j<2);
}
main( )
{ int k,a[10]={1,2,3,4,5);
for(k=1;k<3;k++)fun(a);
for(k=0;k<5;k++)printf(”%d”,a[k]);
printf("\n");
}
程序运行后的输出结果是
A) 12345
B)23445
C)34756
D) 35745
第6题:
以下程序的输出结果是 void fun(int*s) { static int j=0; do s[j]+=s[j+1]; while(++j<2);} main() { int k,a[10]={1,2,3,4,5}; for(k=1;k<3;k++)fun(a); for(k=0;k<5;k++)printf("%d",a[k]);}
A.34756
B.23345
C.35745
D.12345