更多"有以下程序: #include<iostream> using n"的相关试题:
[单项选择]有以下程序: #include<iostream> using namespace std; int n[][3]={10,20,30,40,50,60}; int main( ) { int (*p)[3]; p=n; cout<<p[0] [0]<<","<<*(p[0]+1)<<","<<(*p) [2]<<end1; return 0; } 上述程序执行后的输出结果是( )。
A. 10,20,30
B. 20,30,40
C. 10,30,50
D. 10,40,60
[单项选择]若有以下程序: #include <iostream> using namespace std; int main( ) { int a=3; cout<<(a+=a-=a+A) <<end1; return 0; } 程序执行后的输出结果是( )。
A. -6
B. 12
C. 0
D. -12
[单项选择]有以下程序#include <iostream>using namespace std;int a;int fun ( );int main ( ){ extern int a; int b; a = 100; b = fun( ); cout<<b<<end1; return 0;}int fun{){ extern int a; return (10*a ;} 其程序运行后的输出结果是
A. 100
B. 10
C. 1000
D. 10000
[单项选择]若有以下程序:# include <iostream>using namespace std;void sub(int x, int y, int *z){ *z = y+x;}int main ( ){ int a,b, c; sub[8,4.&a) ; sub (6, a, &b) ; sub (a.b, &c) ; cout<<a<<" , "<<b<<", "<<c<<end1; return 0;} 程序运行后的输出结果是
A. 12,18,30
B. -12,6,8
C. 6,8,10
D. 12,-18,16
[单项选择]若有以下程序段; #include<iostream> using namespace std; int main( ) { int a[]={1,4,5}; int *p=&a[0],x=6,y,z; for(y=0;y<3;y++) z=((*(p+y)<x) *(p+y):x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。
A. 1
B. 4
C. 5
D. 2
[单项选择]以下程序的输出结果是#include <iostream>using namespace std;int main( ){ cout.fill('*'); cout.width(5); cous<<hex<<100<<end1; return 0;}
A. **100
B. ***64
C. 100**
D. 64***
[单项选择]有如下程序: #include<iostream> using namespace std; class A{ public: static int a; void init( ){a=1;} A(int a=2){init( ); a++;} }; int A::a=0; A obj; int main( ) { cout<<obj.a; return 0; 运行时输出的结果是( )。
A. 0
B. 1
C. 2
D. 3