更多"若有以下程序: #include <iostream> using"的相关试题:
[单项选择]若有以下程序:
#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. ;
B. ;
C. ;
[单项选择]若有以下程序:#include <iostream>using namespace std;int f( ){ static int i = O; ints= 1; s+=i; i++; return s;}int main( ){ int i, a =0; for(i=0;i<5;i++) a+=f( ); cout<<a<<end1; return 0;}程序运行后,输出的结果是( )。
A. 20
B. 24
C. 25
D. 15
[单项选择]若有以下程序:# 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( ) { char *p="abcdefgh",*r; long *q; q=(long *)p; q++; r=(char *)q; cout<<r<<end1; return 0; } 上述程序的输出结果是( )。
A. abcdefgh
B. 0
C. abcd
D. efgh
[单项选择]若有如下程序段: #include<iostream> using namespace std; int main ( ) { char*p="abcdefgh",*r; r=p; cout<<*r<<end1; return 0; } 该程序的输出结果是( )。
A. a
B. b
C. c
D. d
[单项选择]有以下程序: #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