更多"下列程序的输出结果是 【15】 。 #include<iostream"的相关试题:
[单项选择]下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) {return n1 +n2;} float test (int f1,float f2){return f1-f2;} float test(float x,float y){return(x+y)/2;} float test(float x,int y){return(x+y)*2;} void main( ){ int a1=10; float a2=2.5f; cout<<test(a1,a2); }
A. 12.5
B. 7.5
C. 6.25
D. 25
[单项选择]如下程序运行时的输出结果是
#include<iostream>
using namespace std;
class ONE
int c;
public:
ONE( ):c(0)eout<<1;
ONE(int n):C(n)cout<<2;
;
class TW0
ONE onel;
ONE one2;
public:
TWO(int m):one2(m)eout<<3;
;
int main( )
TWO t(4);
return 0;
A. 3
B. 23
C. 123
D. 213
[单项选择]下面程序的输出结果是( )。
#include<iostream>
using namespace std;
void swap(int x[2])
int t;
t=x[0];
x[0]=x[1];
x[1]=t;
void main( )
int a[2]=4,8;
swap(
A. ;
[单项选择]以下程序的输出结果是( )。
#include<iostream>
using namespace std;
void fun(char**q)
++q;
cout<<*q<<end1;
main( )
static char*s[]="HI","HELL0","TEST";
char**p;
p=s;
fun(p);
system("PAUSE");
return 0;
A. 为空
B. HI
C. HELL0
D. TEST
[单项选择]下列程序的输出结果是( )。
#include<iostream>
using namespace std;
int main( )
char a[]=""Hello,World";
char*ptr = a;
while(*ptr)
if(*ptr>= ’a’ &&*ptr<=’z’)
cout<<char(*ptr+’A’-’a’);
else cout<<*ptr;
ptr++;
retur 0;
A. HELLO, WORLD
B. Hello, World
C. HELLO, world
D. hello, world