编译器说:
6: error: expected unqualified-id before '{' token
6: error: expected `,' or `;' before '{' token
24:1:warning: null character(s) ignored 2008-06-20 16:24
大家看这个c++程序哪里错了?
答案:3 悬赏:10 手机版
解决时间 2021-04-13 15:50
- 提问者网友:我们很暧昧
- 2021-04-13 05:19
最佳答案
- 五星知识达人网友:长青诗
- 2021-04-13 05:26
cout<<"name"<<name<<endl;cout<<"age"<<age<<endl;cout<<"sex:"<<sex<<endl;cout<<"post:"<<post<<endl;cout<<"address:"<<addr<<endl;cout<<"tel:"<<tel<<endl;}class Person:public Teacher,public Cadre{public:Person(string nam,int a,char s,string tel,string p,string ad,string t,float w);void show();private:float wage;};Person::Person(string nam,int a,char s,string tel,string p,string ad,string t,float w):Teacher(nam,a,s,t,ad,tel),Cadre(nam,a,s,p,ad,tel),wage(w){}void Person::show(){Teacher::display();cout<<"post:"<<Cadre::post<<endl;cout<<"wage:"<<wage<<endl;}int main(){Person person1("wang-li",50,'f',"prof","president","135 Beijing Road,Shanghai","(021)61234567",1534.5);person1.show();return 0;}
全部回答
- 1楼网友:琴狂剑也妄
- 2021-04-13 06:39
第六行缺{
第二十四行的那个我不知道
- 2楼网友:由着我着迷
- 2021-04-13 05:53
//你肯定是打错字了(或者粗心),下面这个通过运行了 // #include int main() { using namespace std; cout.setf(ios_base::fixed, ios_base::floatfield); float tub = 10.0 / 3.0; double mint = 10.0 /3.0; const float million = 1.0e6; cout << "tub= " < -->
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯