-
个人简介
头像是我梦角。。。。
#include <bits/stdc++.h> #include #include #include #include <windows.h> using namespace std; string s = "0"; int main() { string names[]= {"小年","玫瑰","失眠夜","小涵","椿璃" }; srand(time(0)); int index=rand()%2; int index2=rand()%5; int n = 1; char c = 'Y'; while(c=='Y') {
// 滚动效果 cout<<"---------下面开始抽奖---------"<<endl; for (int i = 0; i < 3; i++) { // 滚动10次 for (int j = 0; j < 5; j++) { cout<< "\r正在抽奖: "<< names[j]; Sleep(100); // 延时 } } cout<<endl<<"-----------中奖的是-----------"<<endl; Sleep(1000); // 输出结果 cout << "抽到的人是:" << names[index] << endl; if(index2 == 0) { cout<<"不好意思,你没有复活机会"<<endl; break; } else { if(n>=1) { cout<<"你有一次复活机会,请问是否使用?"<<endl<<"请输入你的选择(Y/N):"; n--; cin>>c; index = rand() % 5; } else { break; } } }
}
-
通过的题目
-
最近活动
-
最近编写的题解
This person is lazy and didn't write any solutions.
题目标签
- 语言基础
- 34
- 一维数组
- 15
- 语言入门
- 15
- 选择语句
- 14
- 循环语句
- 7
- 二维数组
- 4
- 基础语法
- 3
- 竞赛
- 3
- python
- 3
- 2005
- 2
- 模拟
- 2
- NOIP
- 2
- 普及组
- 2
- 其他
- 2
- 数学
- 2
- 循环
- 1
- 入门
- 1
- 高精度
- 1
- CSP
- 1
- 年份
- 1