有以下程序: void sum(int *a) { a[0]=a[1]; ) main() { int aa[10]={1,2,3,4,5,6,7,8,9,10}, i; for(i=2;i>=0;i--) sum(aa[i]); printf("%d\n",aa[0]); } 执行后的输出结果是( )。A.4B.3C.2D.1
有以下程序: void sum(int *a) { a[0]=a[1]; ) main() { int aa[10]={1,2,3,4,5,6,7,8,9,10}, i; for(i=2;i>=0;i--) sum(&aa[i]); printf("%d\n",aa[0]); } 执行后的输出结果是( )。
A.4
B.3
C.2
D.1
相关考题:
有以下程序:#define N 20fun(int a[],int n,int m){ int i; for(i=m;in;i--)a[i+1]=a[i]; return m;}void main(){ int i,a[N]={1,2,3,4,5,6,7,8,9,10}; fun(a,0,N/2); for(i=0;i5;i++)printf("%d",a[i]);}程序运行后的输出结果是( )。A.10234 B.12344 C.12334 D.12234
有以下程序: void sort(int a[],int n) { int i,j,t; for(i=0;i<n-1;i+=2) for(j=i+2;j<n;j+=2) if(a[i]<a[j]){t=a[i];a[i]=a[j];a[j]=t;} } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa,10); for(i=0;i<10;i++) printf("%d",aa[i]); printf("\n"); } 其输出结果是( )。A.1,2,3,4,5,6,7,8,9,10,B.10,9,8,7,6,5,4,3,2,1,C.9,2,7,4,5,6,3,8,1,10,D.1,10,3,8,5,6,7,4,9,2,
有以下程序: void sum(int *a) { a[0]= a[1]; } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; for(i=2;i>=0;i--)sum(aa[i]); printf("%d\n",aa[0]); } 执行后的输出结果是 ______。A.4B.3C.2D.1
以下程序的输出结果是#include(iostream. hvoid reverse(int a[],int n){ int i,t;for(i=0;;{t=a[i];a[i]=a[n-1-i];a[n-1-i]=t;}}void main(){ int b[10]={1,2,3,4,5,6,7,8,9,10};int i,s=0;reverse(b,8);for(i=6;i 10;i++)s+=b[i];cout }A.22B.10C.34D.30
有以下程序: void sum(int *A) { a[0] =a[1]; } main ( ) { int aa[10]={1,2,3,4,5,6,7,8,9,10}, i; for (i=2 ;i>=0;i--) sum(aa[i] ); print f ("%d\n",aa[0]); } 执行后的输出结果是A.4B.3C.2D.1
以下程序的输出结果是 void reverse(int a[],int n) { int i,t; for(i=0;i<n/2;i++) { t=a[i]; a[i]=a[n-1-i];a[n-1-i]=t;} } main() { int b[10]={1,2,3,4,5,6,7,8,9,10};int i,s=0; reverse(b,8); for(i=6;i<10;i++)s+=b[i]; printf("%d\n",s); }A.22B.10C.34D.30
有以下程序:include void sum(int a[ ] ){a[0]=a[-1] +a[1];}main ( ){int a[10] = { 有以下程序:#include <stdio, h>void sum(int a[ ] ){ a[0]=a[-1] +a[1];}main ( ){ int a[10] = {1,2,3,4,5,6,7,8,9,10}; sum(a[2]); prinff("% d \n",a[2]); }程序运行后的输出结果是( )。A.6B.7C.5D.8
有以下程序:include void f(int a[],int i, int j){int t; if(i 有以下程序: #include <stdio.h> void f(int a[],int i, int j) { int t; if(i<j) { t=a[i];a[i]=a[j];a[j]=t; f(a,i+1,j-1); } } main() { int i,aa[5]={1,2,3,4,5}; f(aa,0,4); for(i=0;i<5;i++) printf("%d,",aa[i]);printf("\n"); } 执行后的输出结果是( )。A.5,4,3,2,1,B.5,2,3,4,1,C.1,2,3,4,5,D.1,5,4,3,2,
下列程序段的输出结果是【】。 include void main() {inti=10,sum=0;do{sum=+sum+i;i=i 下列程序段的输出结果是【 】。include<iostream.h>void main(){int i=10,sum=0;do{sum=+sum+i;i=i-2;}while(i>=2);cout<<sum<<end1;}
以下程序的输出结果是【】。 include using namespace std; int main(){ int sum,i; for( 以下程序的输出结果是【 】。include<iostream>using namespace std;int main(){int sum,i;for(sum=0,i=1;i<5;i++)sum+=i;cout<<sum<<endl;return 0;}
以下程序的输出结果是includevoid reverse(int a[],int n){ int i ,t; for(i=0; 以下程序的输出结果是 #include<iostream.h> void reverse(int a[],int n) { int i ,t; for(i=0;<n/2;i++) { t=a[i]=a[i] =a[n-1-i];a[n-1-i]=t;} } void main() { int b[10]={1,2,3,4,5,6,7,8,9,10};int i,s=0; reverse(b,8); for(i=6;i<10;i++)s+=b[i]; cout<<s; }A.22B.10C.34D.30
有以下程序:include void sum(int *a){a[0]=a[1];}main(){int aa[10]={1,2,3,4,5,6,7, 有以下程序: #include <stdio.h> void sum(int *a) { a[0]=a[1]; } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; for(i=2;i>=0;i--) sum(aa[i]); printf("%d\n",aa[0]); } 执行后的输出结果是( )。A.4B.3C.2D.1
有以下程序: include void sort(int a[] ,int n){int i,j,t; for(i=0;i 有以下程序: #include <stdio, h>void sort(int a[] ,int n){ int i,j,t; for(i=0;i<n;i ++ ) for(j =i+ 1;j<n;j ++ ) if(a[i]<a[j]){ t=a[1] ;a[i]=a[j] ;a[j] =t; }main( ){ int aa[10] = {1,2,3,4,5,6,7,8,9,10} ,i; sort(aa +2, 5); for(i =0;i<10;i++) prinff("%d," ,aa[i]); prinff("\n");程序运行后的输出结果是( )。A.1,2,3,4,5,6,7,8,9,10,B.1,2,7,6,3,4,5,8,9,10,C.1,2,7,6,5,4,3,8,9,10,D.1,2,9,8,7,6,5,4,3,10,
有以下程序: void sort(int a[],int n) { int i,j,t; for(i=0;i<n;i++) for(j=i+1;<n;j++) if(a[i]<a[j]){ t=a[i]; a[i]=a[j]; a[j]=t; } } main() {int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa+2,5); for(i=0;i<10;i++)printf("%d,",aa [i]); printf("\n"); } 程序运行后的输出结果是 ______ 。A.1,2,3,4,5,6,7,8,9,10,B.1,2,7,6,3,4,5,8,9,10,C.1,2,7,6,5,4,3,8,9,10,D.1,2,9,8,7,6,5,4,3,10,
下面程序执行的结果是【 】。 include using namespace std; void main(){ int sum=0; i 下面程序执行的结果是【 】。include <iostream>using namespace std;void main(){int sum=0;int array[6]={1,2,3,4,5,6};int *p;p=array[0];for(int i=0;i<6;i++){sum=sum+*p;p++;}cout<<sum;}
以下程序的输出结果是includevoid reverse(int a [ ] ,int n){int i,t;for(i=0;i 以下程序的输出结果是 #include<iostream.h> void reverse(int a [ ] ,int n) {int i,t; for(i=0;i<n/2;i++) {t=a[i];a[i]=a[n-1-i];a[n-1-i]=t;} } void main( ) {int b[10]={1,2,3,4,5,6,7,8,9,10};int i,s=0; reverse(b,8); for(i=6;i<10;i++)s+=b[i]; cout << S; }A.22B.10C.34D.30
有以下程序 include void fun(int a[],int n) { int i,t; for(i=0; 有以下程序 #include <stdio.h> void fun(int a[],int n) { int i,t; for(i=0;i<n/2;i++) {t=a[i]; a[i]=a[n-1-i]; a[n-1-i]=t;} } main() {int k[10]={1,2,3,4,5,6,7,8,9,10},i; fun(k,5); for(i=2;i<8;i++) printf("%d",k[i]); printf("\n"); } 程序的运行结果是______。A.345678B.876543C.1098765D.321678
有以下程序: void sum(int *A) {a[0]=a[1];} main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; for(i=1;i>0;i--)sum(aa[i]); printf("%d\n",aa[0]); } 程序运行后的输出结果是______。A.4B.3C.2D.1
以下程序的输出结果是 include void reverse(int a[ ] ,int n) { int i,t;for(i=0 以下程序的输出结果是#include<iostream.h>void reverse(int a[ ] ,int n){ int i,t;for(i=0;i<n/2;i++){t=a[i] ;a[i] =a[n-1-i] ;a[n-1-i] =t;}}void main( ){ int b[10] ={1,2,3,4,5,6,7,8,9,10};int i,s=0;reverse(b,8) ;for(i=6;i<10;i++) s+=b[i] ;cout < < S;}A.22B.10C.34D.30
以下程序的输出结果是()。includevoid reverse(int a [],int n){int i,t; for(i=0;i 以下程序的输出结果是( )。 #include <stdio.h> void reverse(int a [],int n) { int i,t; for(i=0;i<n/2;i++) { t=a[i]; a[i]=a[n-1 -i];a[n-1-i] =t;} } main() { int b[10]={1,2,3,4,5,6,7,8,9,10};int i,s=0; reverse(b,8); for(i=6;i<10;i++)s+=b[i]; printf("%d\n",s); }A.22B.10C.34D.30
以下程序的输出结果是includevoid reverse(int a [ ] ,int n){int i,t;for(i=0;i 以下程序的输出结果是 #include<iostream.h> void reverse(int a [ ] ,int n) {int i,t; for(i=0;i<n/2;i++) {t=a[i];a[i]=a[n-1-i];a[n-1-i]=t;} } void main( ) {int b[10]={1,2,3,4,5,6,7,8,9,10}A.22B.10C.34D.30
下列程序执行后的结果是______。public class ex24{public static void main(String[] args){int j=10;a1: for(int i=3;i>0;i--){j-=i;int m=l;a2: while (m<j){if (i<=m)continue a1;j/=m++;}}System.out.println(j);}}下列嵌套的循环程序执行后,结果是______。 public class ax25 { public static void main(String[] args) { int sum=0; for(int i=0;i<=5;i++) { for(int j=10;j>3*i;j--) { sum+=j*i; } } System.out.println(sum); } }A.136B.127C.147D.153
有以下程序,程序执行后,输出结果是【】include void fun(int*A) {a[0]=a[1];} main() {i 有以下程序,程序执行后,输出结果是【 】include<stdio.h>void fun(int*A){ a[0]=a[1];}main(){ int a[10]={10,9,8,7,6,5,4,3,2,1,},i;for(i=2;i>1=0;i-) fun(a[i]);for(i=0;i<10;i++) printf("%d,a[i]);printf("\n");}
有以下程序void sort(int a[],int n){ int i,j,t; for(i=0;in-1;i+=2) for(j=i+2;jn;j+=2) if(a[i]a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; }}main(){ int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa,10); for(i=0;i10;i++) printf("%d,",aa[i]); printf("\n");}执行后的输出结果是A.1,2,3,4,5,6,7,8,9,10, B.10,9,8,7,6,5,4,3,2,1, C.9,2,7,4,5,6,3,8,1,10 D.1,10,3,8,5,6,7,4,9,2,
有以下程序: include using namespace std; int main() {int i=1,sum=0;Loop:if(i 有以下程序:include<iostream>using namespace std;int main(){int i=1,sum=0;Loop:if(i<=20){sum+=i;i++;goto Loop;}cout<<sum<<end1;return 0;}该程序运行后的输出结果是【 】。
有以下程序: void sort(int a[], int n) {int i,j,t; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(a[i]<a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; } } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa+2,5); for(i=0;i<10;i++)printf("%d,",aa[i]); printf("\n"); } 程序运行后的输出结果是( )。A.1,2,3,4,5,6,7,8,9,10,B.1,2,7,6,3,4,5,8,9,10,C.1,2,7,6,5,4,3,8,9,10,D.1,2,9,8,7,6,5,4,3,10,
有以下程序:includevoid sort(int a[],int n){int i,j,t; for(i=0;i 有以下程序: #include <stdio.h> void sort(int a[],int n) { int i,j,t; for(i=0;i<n-1;i+=2) for(j=i+2;j<n;j+=2) if(a[i]<a[j]){t=a[i];a[i]=a[j];a[j]=t;} } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa,10); for(i=0;i<10;i++) printf("%d.",aa[i]); printf("\n"); } 其输出结果是( )。A.1,2,3,4,5,6,7,8,9,10,B.10,9,8,7,6,5,4,3,2,1,C.9,2,7,4,5,6,3,8,1,10,D.1,10,3,8,5,6,7,4,9,2,
单选题有以下程序:#include void fun(int a[],int n){ int i,t; for(i=0;i { t=a[i]; a[i]=a[n-1-i]; a[n-1-i]=t; }}main(){ int k[10]={1,2,3,4,5,6,7,8,9,10},i; fun(k,5); for(i=2;i printf("");}程序运行的结果是( )。A345678B876543C1098765D321678