单选题1)#include 2)#include 3)using namespace std; 4)double max(double x,doubley) 5){ 6)if(xy) 7)return x; 8)else 9)return y; 10)} 11)int main() 12){ 13)doublea,b,c; 14)cout a b; 16)c=max(a,b); 17)cout " the squart of max imum=" sqrt( c ); 18)}执行第15行时,若输入“8空格9回车”,则执行完第18行后,命令提示符窗口中新输出的结果是:()Athe squart of max imum=sqrtC.Bthe squart of max imum=3.08221Cthe squart of max imum=3Dthe squart of max imum=9.0

单选题
1)#include 2)#include 3)using namespace std; 4)double max(double x,doubley) 5){ 6)if(x>y) 7)return x; 8)else 9)return y; 10)} 11)int main() 12){ 13)doublea,b,c; 14)cout > a >> b; 16)c=max(a,b); 17)cout <<" the squart of max imum="<< sqrt( c ); 18)} 执行第15行时,若输入“8空格9回车”,则执行完第18行后,命令提示符窗口中新输出的结果是:()
A

the squart of max imum=sqrtC.

B

the squart of max imum=3.08221

C

the squart of max imum=3

D

the squart of max imum=9.0


参考解析

解析: 第18行的作用是先在命令提示符窗口中输出字符串"the squart of maximum=",即输出引号里面的内容,然后输出sqrt(c)的值,因此执行完第18行后,命令提示符窗口中新输出的结果是:()the squart of maximum=3。

相关考题:

以下程序的输出结果是【】。 include using namespace std; int main() {char S[]="abcde 以下程序的输出结果是【 】。include <iostream>using namespace std;int main(){char S[ ]="abcdef";s[3]='\0';cout<<s<<end1;return 0;}

有以下面程序: include using namespace std; long fib(int n) { if (n>2)return (fi 有以下面程序:include <iostream>using namespace std;long fib(int n){if (n>2)return (fib(n-1)+fib(n-2));elsereturn 2;}int main(){cout<<fib(3)<<endl;return 0;}则该程序的输出结果应该是【 】。

下列程序的输出结果是______。 include include using namespace std; voi 下列程序的输出结果是______。include<iostream.h>include<string.h>using namespace std;void fun(const char*s,char C) {c=s[strlen(s)/2];}int main(){char str[]="ABCDE";char ch=str[1];fun(str,ch);cout<<ch;return 0;}

有如下程序 include include using namespace std; cla 有如下程序 #include <iostream> #include <iomanip> using namespace std; class MyClass { public: MyClass() { cout<<'A'; } MyClass(char c){ cout<<c; } ~MyClass(){ cout<<'B'; } }; int main( ) { MyClass p1,*p2; p2=new MyClass('X'); delete p2; return 0; } 执行这个程序屏幕上将显示输出A.ABXB.ABXBC.AXBD.AXBB

有如下程序: include using namespace std; class Sample{ public: 有如下程序: #include<iostream> using namespace std; class Sample{ public: Sample()<) ~Sample(){cout<<'*';} }; int main(){ Sample temp[2],*pTemp[2]; return 0; } 执行这个程序输出星号(*)的个数为( )。A.1B.2C.3D.4

阅读下面程序: include using namespace std; long fib(int n) {if(n > 2) return(fib 阅读下面程序:include<iostream>using namespace std;long fib(int n){if ( n > 2 )return (fib(n-1)+fib(n-2));elsereturn 2;}int main(){cout<<fib(3)<<end1;return 0;{则该程序的输出结果应该是【 】。

执行如下程序后的输出结果是【】。include include using namespace std;int ma 执行如下程序后的输出结果是【 】。include <iostream>include <fstream>using namespace std;int main ( ){char s[25];ofstream fl("data.txt");f1<<"C++ Programming";f1.close ();ifstream f2 ("data.txt");

程序的输出结果是【 】。 include using namespace std; class A{ int x; public: A(int 程序的输出结果是【 】。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);}

下面程序的执行结果是______。 include include using namespace std; vo 下面程序的执行结果是______。include<iostream.h>include<iomanip.h>using namespace std;void main(){cout<<setfill('x')<<setw(10);cout<<"Hello"<<endl;}

有下列程序:include using namespace std; class TestClass1 { public: TestClass1(){ 有下列程序:include<iostream>using namespace std;class TestClass1{public:TestClass1(){cout<<"A";}};class TestClass2<public:TestClass2(){cout<<"B";}};class TestClass3:public TestClass1{TestClass2 b;

下列程序的执行结果是______。 include include using namespace std; vo 下列程序的执行结果是______。include<iostream.h>include<iomanip.h>using namespace std;voidmain(){cout<<setfill('x')<<setw(10);cout<<"Hello"<<end1;}

下面程序的执行结果是【】。 include include using namespace std; void main( 下面程序的执行结果是【 】。include<iostream>include<iomanip>using namespace std;void main(){cout<<setfill('x')<<setw(10);cout<<"Hello"<<endl;}

有以下程序: include using namespace std; int main() {int x;for(int i=1;i 有以下程序: #include <iostream> using namespace std; int main() { int x; for(int i=1;i<=100;i++) { x=i; if (++x%2==0) if (++x%3==0) if (++x%7==0) cout<A.39,81B.42,84C.26,68D.28,70

有下列程序: include using namespace std; class Demo { public: Demo(){cout 有下列程序: #include<iostream.h> using namespace std; class Demo { public: Demo(){ cout<<"default constmctor\n";} Demo(const Demo x){ cont<<"copy constructor\n";} }; Demo userCode(Demo b){Demo c(b);return c;} intA.1和1B.1和2C.2和3D.2和4

以下程序的输出是【】。 include using namespace std; fun(intm) { static int n=1; n=m 以下程序的输出是【 】。include<iostream>using namespace std;fun(intm){static int n=1;n=m*n;return(n);}void main(){int i;for(i=1;i<=3;i++) cout<<fun(i);}

以下程序的运行结果是【】。 include include using namespace std; void main() 以下程序的运行结果是【 】。include<iostream>include<string>using namespace std;void main(){chara[10]="China",b[]="Chin",c[]="ese";cout<<strlen(strcat(strcpy(a,b),c))<<endl;}

根据下面的程序,可以在主程序中使用的合法语句是( )。 include using namespa 根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person{ int age; voidtest(){} public: Person(intage){this->age=age;} void ShowAge(){cout<<"the Person's age is",<<age;} }; void main(){ Person wang(23); }A.wang.age=45B.wang.wang(45)C.wang.ShowAge()D.wang.test()

有如下程序: include include using namespace std; int ma 有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout << left << setw(4) << 123 << "OK" << endl; return 0; }A.123*OKB.123*OK**C.*123OKD.*123**OK

有以下程序: include include using namespace std; int main() {char arr[ 有以下程序: #include<iostream> #include<string> using namespace std; int main() { char arr[2][4]; strcpy(arr[0],"you"); strcpy(arr[1],"me"); arr[0][3]=''; cout<<arr[0]<<end1; return 0; } 执行后的输出结果是( )。A.youmeB.youC.meD.err

有下列程序: include using namespace std; classBase { protected: int i; public 有下列程序: #include<iostream.h> using namespace std; classBase { protected: int i; public: int j; }; classDerived:public Base { int m; public: intn; }; intA.[1]和[2]B.[1)和[3]C.[2]和[3]D.[2]和[4]

有如下程序: include include using namespace std; int main() {cout.f 有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0; } 执行生的输出结果是( )。A. ###123B.123###C. ***123D.123***

有如下程序include include using namespace std;class MyClass {public:M 有如下程序#include <iostream>#include <iomanip>using namespace std; class MyClass {public:MyClass(){ cout<<'A'; }MyClass(char c){ cout<<c; }~MyClass(){ cout<<'B'; }};int main() {MyClass p1,*p2;p2=new MyClass('X');delete p2;return 0;}执行这个程序屏幕上将显示输出( )。A.ABXB.ABXBC.AXBD.AXBB

有以下程序:include include using namespace std;int main ( ){ char b1[8 有以下程序: #include <iostream> #include <string> using namespace std; int main ( ) { char b1[8] = "abcdefg"; char b2[8],*pb=b1+3; while (--pb>=b1) strcpy (b2, Pb) ; cout<<strlen (b2) <<end1; return 0; } 程序运行后的输出结果是( )。A.8B.3C.1D.7

下面程序的运行结果为( )。 include using namespace std; void main(){ 下面程序的运行结果为( )。 #include<iostream> using namespace std; void main(){ int a=1; switch(a){ case 1:cout<<"1"; case 2:cout<<"2"; break; default:cout<<"0"; } }A.12B.120C.1D.10

下面的程序输出的结果是( )。 include using namespace std; void main(){ 下面的程序输出的结果是( )。 #include <iostream> using namespace std; void main(){ int a=2; int c=a; a++; cout<<c; }A.2B.3C.4D.*a

有以下程序: include using namespace std; int main() {char a[10] = {'1','2','3', 有以下程序: #include<iostream> using namespace std; int main() { char a[10] = {'1','2','3','4','5','6','7','8','9','0'),*p; int i=8; p=a+i; cout<<p-3<<end1; return 0; } 执行程序后的输出结果是( )。A.6B.6789C.'6'D.789

有以下程序 include using namespace std; long fib(int n) { if(n>2) return(fib(n-1 有以下程序include<iostream>using namespace std;long fib(int n){if(n>2)return(fib(n-1)+fib(n-2));elsereturn 2;}int main( ){cout<<fib(3)<<endl;return 0;}则该程序的输出结果应该是______。

使用标准命名空间的语句是()A、using namespace std;B、using namespace iostream;C、include std;D、include iostream;