更多"下列程序的输出结果是【 】。
#inClude<iostre"的相关试题:
[单项选择]下列程序的输出结果是 #include"iostream" using namespace std; int Max(int a,int b) { if(a>b) return a; else return b; } void main( ) { int m,n; m=10,n=5; int max = Max(m,n); cout<<max<<endl; }
A. 10
B. 程序有误
C. 1
D. 0
[单项选择]如下程序的输出结果是
#include<iostream>
using namespace std;
class MyClass
public:
MyClass(int i=0)cout<<1;
MyClass(const MyClass&x)cout<<2;
;
int main( )
MyClass objl(1),obj2(2),ohj3(objl);
return 0;
A. 112
B. 111
C. 121
D. 113
[单项选择]下列程序的输出结果是 #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++; } return 0; }
A. HELL WORLD
B. Hello, World
C. hELLO, wORLD
D. hello, world
[单项选择]下列程序的输出结果是
#include" iostream"
using namespace std;
int Max(int a,int b)
if(a > b)
else
return a;
else
retum b;
void main( )
int m,n;
m=10,n=5;
int max=Max(m,n);
cout < < max < < end1;
A. 10
B. 程序有误
C. 1
D. 0
[填空题]下列程序输出结果是 【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;
}
[填空题]下列程序输出结果是 【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;
int Max(int a,int b)
if (a > b)
return a;
else
return b;
void main( )
int m,n;
m=10,n=5;
int max=Max(m,n);
cout<<max<<endl;
A. 10
B. 程序有误
C. 1
D. 0