大家帮我改改错,一个C++编译的数字游戏

来源:百度知道 编辑:UC知道 时间:2024/05/26 15:07:16
游戏规则:电脑随机出现一个数,玩家输入一个数,跟赌注,如果相同,玩家获取赌注,如果不同,玩家损失金钱。开始100元,我已经把大体框架弄出来了,希望有高人帮我改改语法错误

#include<iostream>
#include<time.h>
using namespace std;
void main()
{
srand((unsigned)time(0));
int ran,own;
int money=100;
while(money>0)
{
ran=rand()%99;
cout<<"please input a number:";
cin>>own;
if(ran==own)
{
cout<<"you win"<<endl;
money+=100;

}
else
cout<<"the random is"<<ran<<endl;
cout<<"you lose"<<endl;
money-=10;

cout<<"you hava"<<money<<endl;
}
if(money<10)
cout<<"you are empty";
}

这里有个代码,自己看看去

代码呢?

没代码。。

没代码~~再好的程序也出不来~~