#include
#include
#include
using namespace std;
int main()
{
int n,a;
cout<<“抽奖程序”<<endl;
cout<<“输入1~5的任意一个数:”;
cin>>n;
srand(time(0));
a=rand()%5+1;
if(n==a)cout<<“恭喜你,中奖了!奖金10元!”<<endl;
else cout<<“没中奖,请付2元!”<<endl;
cout<<“中奖的号码是”<<a<<endl;
return 0;
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交