| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 502 人关注过本帖
标题:总有一处错误 求改错
取消只看楼主 加入收藏
tlj
Rank: 1
等 级:新手上路
帖 子:8
专家分:2
注 册:2014-2-28
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
总有一处错误 求改错
#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;
}
搜索更多相关主题的帖子: private include public second money 
2014-03-12 22:28
tlj
Rank: 1
等 级:新手上路
帖 子:8
专家分:2
注 册:2014-2-28
收藏
得分:0 
回复 2楼 rjsp
谢谢指导
2014-03-13 22:23
tlj
Rank: 1
等 级:新手上路
帖 子:8
专家分:2
注 册:2014-2-28
收藏
得分:0 
回复 5楼 Susake
初学者   当局者迷
2014-03-14 19:42
快速回复:总有一处错误 求改错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016260 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved