实现效果如下:(这是其中一部分)
下面是实现方法:
# include <iostream>
using namespace std;
int main()
{
while (1)
{
int Circle;
cout << "请输入圈数:" << endl;
cin >> Circle;
if (Circle >= 5 && Circle <= 10)
{
if (Circle == 10)
cout << "特等奖,奖励100元" << endl;
if (Circle >= 8 && Circle <= 9)
{
cout << "一等奖" << endl;
if (Circle == 8)
cout << "奖励45元" << endl;
else
cout << "奖励50元" << endl;
}
if (Circle >= 6 && Circle <= 7)
{
cout << "二等奖" << endl;
if (Circle == 7)
cout << "奖励30元" << endl;
else
cout << "奖励25元" << endl;
}
if (Circle == 5)
cout << "三等奖,奖励20元" << endl;
}
else
cout << "其余未得奖" << endl;
}
system("pause");
return 0;
}
注意:while(1)的作用是能在控制台窗口一直输入圈数。
先介绍到这里,欢迎大家在评论区留言~