跪求高手帮忙改一下 C++程序问题 在线等

[复制链接]
查看11 | 回复2 | 2010-1-7 14:19:19 | 显示全部楼层 |阅读模式
哪有错误?你先说出来。 你的程序要干什么?我看好像有很多地方都可以改简单点呢?
回复

使用道具 举报

千问 | 2010-1-7 14:19:19 | 显示全部楼层
My system is Linux now , have a Mark.
回复

使用道具 举报

千问 | 2010-1-7 14:19:19 | 显示全部楼层
//简单帮你改了一下,编译通过,且可以正确运行,没有帮你优化代码,因为不知道你的具体用途,将就着用吧。#include #include #include #include using namespace std;class CSportLot;class CWelfardLot;class CCustomer{public: CCustomer(){pSport = pWelfare = NULL;} void SetSport(int *p){pSport = p;} void SetWelfare(int *p){pWelfare = p;} int Compare(CSportLot &); int Compare(CWelfardLot &);private: int *pSport; int *pWelfare;};class CSportLot{private: int LotNum[7];public: CSportLot(){} void Setlot(); void PrintLot(); friend int CCustomer::Compare (CSportLot &);};class CWelfardLot{private: int LotNum[6];public: CWelfardLot(){} void SetLot(); void PrintLot(); friend int CCustomer::Compare (CWelfardLot &);};int CCustomer::Compare (CSportLot &sportlot){ int t=0; for(int i = 0;iusersport;if(usersport>=10||usersportuserwelfare; if(userwelfare>20||userwelfare>strChoice; if(strChoice=="1")
SportLottery(); else if(strChoice=="2")
WelfareLottery(); else if(strChoice!="3")
cout <<"\t\t 输入错误,请重新选择: \n";}while(strChoice!="3");cout <<"\n\n\t\t 谢谢使用,下次再见!\n"; return 0;}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行