总有一处错误 求改错
#include<iostream>using namespace std;
class RMB{
public:
void setmoney(int newY=8,int newJ=7,int newF=5);
void showmoney();
private:
int Yuan,Jiao,Fen;
};
void RMB::setmoney(int newY,int newJ,int newF){
Yuan=newY;
Jiao=newJ;
Fen=newF;
}
inline void RMB::showmoney(){
cout<<Yuan<<":"<<Jiao<<":"<<Fen<<endl;
}
int main(){
RMB myRMB;
cout<<"first money set and output:"<<endl;
myRMB.setmoney();
myRMBshowmoney();
cout<<second money set and output:"<<endl;
myRMB setmoney(3,4,6);
myRMB showmoney();
return 0;
}