一个简单的C++程序,请问输出的结果show函数无法输出正确结果?

2025-05-17 12:54:26
推荐回答(2个)
回答(1):

        ——我不信命,我信爱情是没有理由悲欢的注定。   

回答(2):

好啦,解决了

 void People::Show(){
     int i;
    cout <            cout<    //cout<}
void People::Input(){
    int i,m;
    cout<<"Please Input the Number:"<    cin>>num;
    cout<<"Please Input the Name:(4)"<    
            cin>>name;
    
    cout<<"Please Input the Sex:(m or f)"<    cin>>sex;
    cout<<"Please Input the Id:(10)"<    for(m=0;m<10;m++){
    cin>>ID[m];
    }
}

你只改这两个函数就可以了。错误的输出未知位置的信息。

结果如下: