问答题
以下程序的输出结果是
#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) 22 B) 10 C) 34 D) 30
【参考答案】
A
热门
试题
单项选择题
以下程序的输出结果是 #include<iostream.h> void main( ) int x=1,y=3; cout < < x++ < < , ; int x=0;x+=y * 2; cout < < x < < , < < y < < , ; cout < < x < < , < < y; A) 1,6,3,1,3 B) 1,6,3,6,3 C) 1,6,3,2,3 D) 1,7,3,2,3