下列程序不能通过编译,应该在划线部分填写的语句是______。 include include 下列程序不能通过编译,应该在划线部分填写的语句是______。include<iostream.h>include<stdlib.h>double Func(int a,int b,char ch){double x;switch(ch){case'+':x=double(a)+b;break;case '-':x=double(a)-b;break;case '*':x=double(a)*b;break;case'/':if(B)x=double(a)/b;elseexit(1);break;default:exit(1);}______}void main( ){cout<<Func(32,6,'-')<<",";cout<<Func(32,6, '*')<<",";cout<<Func(32,6,'/')<<endl;}

下列程序不能通过编译,应该在划线部分填写的语句是______。 include include

下列程序不能通过编译,应该在划线部分填写的语句是______。

include<iostream.h>

include<stdlib.h>

double Func(int a,int b,char ch)

{

double x;

switch(ch)

{

case'+':

x=double(a)+b;

break;

case '-':

x=double(a)-b;

break;

case '*':

x=double(a)*b;

break;

case'/':

if(B)x=double(a)/b;

else

exit(1);

break;

default:

exit(1);

}

______

}

void main( )

{

cout<<Func(32,6,'-')<<",";

cout<<Func(32,6, '*')<<",";

cout<<Func(32,6,'/')<<endl;

}


相关考题:

下列程序对加号进行了重载,划线部分的语句是______。 include include class 下列程序对加号进行了重载,划线部分的语句是______。include<iostream.h>include<math.h>class Triangle{int x,y,z;double area;public:Triangle(int i,int j,int k){double s;x=i;y=j;z=k;s=(x+y+z)/2.0;area=sqrt(s*(s-x)*(s-y)*(s-z));}void disparea( ){cout<<"Area="<<area<<endl;}friend double operator+(Triangle tl,Triangle t2){______}};void main( ){Triangle tl(3,4,5),t2(5,12,13);double s;cout<<"tl:";t1. disparea( );cout<<"t2:";t2. disparea( );s=t1+t2:cout<<"总面积:="<<s<<endl;}

下列程序的输出结果是______。 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 void main() {cout 下面程序的输出结果为______include<iostream.h>void main(){cout<<"Hello\b";}

下面程序错误的语句是①include ②void main( 0③{④int * p = new int[1] ;⑤p =9;⑥co 下面程序错误的语句是 ①#include < iostream.h> ②void main( 0 ③{ ④ int * p = new int[1] ; ⑤ p =9; ⑥ cout <<*p <<end1; ⑦ delete [ ] p; ⑧ }A.④B.⑤C.⑥D.⑦

下列程序中划线处正确的语句是()。 include using namespace std;class Base{public:v 下列程序中划线处正确的语句是( )。 # include <iostream> using namespace std; class Base { public: void fun(){cout<<"Base:: fun" <<endl;} }; class Derived:public Base { void fun() { ______ ∥显式调用基类的函数fun() cout<<"DA.fun();B.Base.fun();C.Base::fun();D.Base- >fun();

下面程序错误的语句是 ① include ② void main( ) ③ { ④ int * p=new int[1] ; ⑤ p 下面程序错误的语句是① #include<iostream.h>② void main( )③ {④ int * p=new int[1] ;⑤ p=9;⑥ cout < < * p < <endl;⑦ delete[ ] p;⑧ }A.④B.⑤C.⑥D.⑦

main函数中发生编译错误的语句是______。 include class A { public: int a; const i main函数中发生编译错误的语句是______。include<iostream.h>class A{public:int a;const int b;A( ):a(10),b(20){}void fun( )const{cout<<"a="<<a<<"\tb="<<b<<endl;}};void main( ){A obj1;const A*ptr=new A;ptr=obj1;ptr->a=100;ptr->fun( );}

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

应在下面程序下划线中填写的正确的语句是( )。 include using namespace std; 应在下面程序下划线中填写的正确的语句是( )。 #include <iostream> using namespace std; class A{ public: void test(){cout<< "this is A!";} }; class B:public A{ void test(){ ______ //显示调用基类函数test() cout<< "this is B!"; } }; void main(){}A.A::test()B.test()C.B::test()D.this->test()

下列程序的输出结果是【】。 include include void main(){ char b[30]; str 下列程序的输出结果是【 】。include<iostream.h>include<string.h>void main(){char b[30];strcpy(b[0],"XY");strcpy(b[1],"YZW");strcpy(b[2],"ZXY");cout<<b<<end1;}

下列程序完成从文件读取文件显示的同时写入第二个文件,则在程序中划线部分应该出现的语句是______。include<iostream.h>include(fstream.h)void main(){fstream filel,file2;charfnl[10],fn2[10],ch;cout<<“输入源文件名”;cin>>fnl;cout<<“输入目标文件名”;cin>>fn2;filel.open(fnl,ios::i

以下程序的执行结果是【】。 include include include int ma 以下程序的执行结果是【 】。include <iostream.h>include <fstream.h>include <stdlib.h>int main(){fstream outfile, infile;outfile.open("D:\\text.dat",ios::out);if(!outfile){cout<<"text.dat can't open"<<end1

有以下程序includevoid main(){int a=5,b=0,c=0;if(a=b+c)cout 有以下程序 #include<iostream.h> void main() {int a=5,b=0,c=0; if(a=b+c)cout<<"***"<<endl; else cout<<"$$$"<<<endl;} 下列选项叙述正确的是( )。A.有语法错不能通过编译B.可以通过编译但不能通过连接C.输出***D.输出$$$

下列程序不能通过编译,应该在划线部分填写的语句是【 】。includeinclude 下列程序不能通过编译,应该在划线部分填写的语句是【 】。include<iostream. h>include<stdlib. hdouble Fune(int a, int b, char ch){double x;switch(ch){case '+':x=double(a) +b;break;case '--':x= double(a) --b;break;case '/':x=double(a) * b;break;case '/':if(B) x=double(a) /b;elseexit(1)breakdefault:exit(1);}______}void main(){cout<<Func(32 , 6 ,'--')<< ",";cout<<Func(32, 6 ,'*') <<",";cout<<Func(32, 6 ,'/') <<end1;}

下面程序错误的语句是 #include“iostream.h” ① void main( ) ② { ③ int A=0; ④ int B; ⑤ B=A; ⑥ cout<<B; ⑦ cout<<A; ⑧ }A.②B.③C.④D.⑥

下列程序编译时发现pb->f(10);语句出现错误,其原因是______。 include class Base { 下列程序编译时发现pb->f(10);语句出现错误,其原因是______。include<iostream.h>class Base{public:void f(int x){cout<<"Base:"<<x<<endl;)};class Derived:public Base{public:void f(char*str){cout<<"Derived:"<<str<<endl;}};void main(void){Derived*pd=new Derived;Pd->f(10);}

下列程序用于将源文件中的字母进行大小写转换,请填写while的请句。include include 下列程序用于将源文件中的字母进行大小写转换,请填写while的请句。include<iostream.h>include<fstream.h>include<iomanip.h>void main(){char ch;fstream file1,file2;char fnl[10],fn2[10];cout<<“输入源文件名:”;cin>>fn1;cout<<“输入目标文件名:”;cin>>fn2;{i

下面程序错误的语句是 #include"iostream.h" ① void main() ② { ③ int A=0; ④ int&B; ⑤ B=A; ⑥ cout<<B; ⑦ cout<<A; ⑧ }A.②B.③C.④D.⑥

对于下面的程序,说法正确的是 include void main( ) {int x=3,y=4,z=2; i 对于下面的程序,说法正确的是 #include<iostream.h> void main( ) { int x=3,y=4,z=2; if(X=y+z) cout <<"x=y+Z"; else cout<<"x!=y+Z";}A.不能通过编译B.输出6C.输出x! =y+zD.输出x=y+z

下面程序错误的语句是①include ②void main()③{④int * p=new int[1]⑤p=9⑥cout 下面程序错误的语句是①#include<iostream.h>②void main()③{④ int * p=new int[1]⑤ p=9⑥ cout<<* p<<end1;⑦ delete []p;⑧}A.④B.⑤C.⑥D.⑦

有以下程序 include void main( ) {int a=5,b=0,c=0; if(a=b+c) cout 有以下程序 #include<iostream.h> void main( ) { int a=5,b=0,c=0; if(a=b+c) cout<<"* * *" <<endl; else cout<<"$$$"<<endl;} 下列选项叙述正确的是A.有语法错不能通过编译B.可以通过编译但不能通过连接C.输出* * *D.输出 $ $ $

下列程序编译错误,是由于划线处缺少某个语句,该语句是______。 include class A { pr 下列程序编译错误,是由于划线处缺少某个语句,该语句是______。include<iostream.h>class A{private:int numl;public:A( ):numl(0){}A(int i):numl(i){}};class B{private:int num2;public:B( ):num2(0){}B(int i):num2(i){}int my_math(A obj1, B obj2);};int B::my_math(A obj1,B obj2){return(obj1.numl+obj2.num2);}void main(void){A objl(4);B obj,obj2(5);cout<<"obj1+obj2:"<<obj.my_math(obj1,obj2);}

请在下列程序的横线处填写正确的语句。include using namespace std; class Base{ publ 请在下列程序的横线处填写正确的语句。include<iostream>using namespace std;class Base{public:void fun(){cout<<"Base fun"<<endl;}};class Derivde:public Base{public:void fun(){______∥ 调用基类的函数

下列程序不能通过编译,应该在划线部分填写的语句是_______。

如下程序编译时发生错误,错误的原因是show函数实现语句错误,则正确的语句应该为______。include<iostream.h>class test{private:int hum;public:test(int);void show( );};test::test(int n){num=n;}test::show( ){cout<<num<<endl;}void main( ){test T(10):T.show( );}

#include iostream.h 命令中,include的意义是:()。