更多"下列程序的输出结果是 【9】 。 #include<iostream"的相关试题:
[填空题]下列程序输出结果是 【13】 。
include <iostream>
using namespace std;
template <typename T>
T fun(T a, T b) return (a<=b)a:b;
int main( )
cout<<fun(3,6)<<’,’<<fim(3.14F, 6.28F)<<end 1;
return 0;
[单项选择]下面程序输出的结果是( )。
#include <iostream>
using namespace std;
void swap(int &a,int &b)
int temp;
temp=a;
a=b;
b=temp;
void main( )
int x=2;
int y=3;
swap(x,y);
cout<<x<<y;
A. 23
B. 32
C. ab
D. ba
[单项选择]以下程序的输出结果是( )。 #include <iostream> using namespace std; int main( ){ int a=1,b; switch(a){ case 1:b=30; case 2:b=20; case 3:b=10; default:b=0; } cout<<b<<endl; return 0; }
A. 30
B. 20
C. 10
D. 0
[单项选择]下面程序的输出结果是( )。
#include <iostream>
using namespace Std;
int main( )
int x[6]=1,3,5,7,9,11,*k,**s;
k=x;
s=&k;
cout<<*(k++)<< “,”<<**s<<end1;
return 0;
A. 3,3
B. 1,1
C. 3,5
D. 3,1
[填空题]程序的输出结果是 【14】 。
#include <iostream>
using namespace std;
class A
int x;
public:
A(int x=1):x(x)cout<<x;
;
void main( )
A a,b(2),c(3);
[填空题]程序的输出结果是 【15】 。
#include <iostream>
using namespace std;
class A
public:
A( )a=b=2;
A(int i,int j)a=i;b=j;
void display( )cout<<a<<b;
private:
int a,b;
;
void main( )
A m,n(4,8);
m.display( );
n.display( );