Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- typedef pair<int, int> PII;
- typedef pair<LL, LL> PLL;
- int main(){
- char c;
- cout << "逢七必过小游戏" << endl;
- cout << "输入y开始 输入n退出: " << endl;
- cin >> c;
- if (c == 'y'){
- int n;
- while (1){
- cout << "请输入1-100的整数: " << endl;
- cin >> n;
- if (n > 100 || n < 1){
- cout << "请输入正确的数字" << endl;
- cout << "---------------------------" << endl;
- continue;
- }
- else if (n % 7 == 0 || n % 10 == 7 || n % 10 == 7){
- cout << "游戏结束, 请重新开始 大傻子" << endl;
- cout << "---------------------------";
- continue;
- }
- else{
- for (int i = n; i <= 100; i++){
- if (i % 7 == 0 || i % 10 == 7 || i % 10 == 7)
- cout << i << endl;
- else cout << "PASS" << endl;
- }
- }
- break;
- }
- }
- else if (c == 'n'){
- cout << "退出成功" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement