• 个人简介

    这是个蒟蒻,你需要的是踩爆他

    此主页仅用于观赏。

    为了获得更好的观赏体验,请点击“我的博客”或“ 博客主页”按钮。

    我的博客 / 博客主页

    Talk is cheap,show me the code!

    Разговор дешево. Покажи мне код.

    小作品:
    1.《耶!》:
    
          ."".  ."",
          |2⁰|  |2¹|
          |2²|  /  /
          |2³| /  /
          |2⁴|/  ;-._
          |2⁵` _/  / ;
          |2⁶/` ) /  /
          | /2⁷/_/\_/
          |/  /2⁸ 2⁹ |
          (  ' \ '- _|
          \    `. _/
          |      |
          |      |
    
    2.《奇异斜线》:
    
          /\__/L_\
           /\/L_L/\/\ \/\ \
            /\L_/L_\/\ _/`\/\/_L/_\
              \/_/\L\/L/\L\/\L\/\/\L\/ /
    	       \/_/\ \/\ \ \/\ \/_/\ \/
    	        \ \ \ \_\ \ \ \ \ \_\ \
    	         \ \ \_\ \_\ \ \ \_\ \_\
    	          \ \_\ \ \ \_\ \_\ \ \ \
    	           \_\ \ \ \ \ \_\ \ \ \ \
                   /\_____\ \_\ \_\ \_\ \_\
                    /\__/_/\ \ \/_/L_\/\/_/L/\/L/_L_/
                      \/_/\/_/___/\/_/___/\/_/___/
    
    3.《鲜花》:
    
           @ @ @
         @ @\@/@ @
         \@|@|@|@/
          \\\|///
           \\|//
            \|/
            =&=
            /|\
    
    4.《中国邮轮》:
    
                 II==OO[/★026China]
                /____/_____|___[]_/
      ----/____/__∩__∩__∩__∩__∩__|~ ~ ~ ~ ~
          \⊙◎⊙◎⊙◎⊙◎⊙◎⊙◎/
    
    5.《老式电视机》:
    
          ._________________.
          | _______________ |
          | I             I |
          | I  I love C++ I |
          | I  AC 1140 10 I |
          | I  Ni Muchen  I |
          | I_____________I |
          !_________________!
             ._[_NO.80_]_.
         .___|___________|___.
         |     ___:⊙:___    |
         |~~~~[ID--11250]~~~~|
         !___________________!
    
    6.《666》:
          6666666666666666666666666666666666
          6666666666666666666666666666666666
          6\\\\\\6\\\\\\\\\\\\\\\\\\6\\\\\\6
          6\\66666\\\\\\\\\\\\\\\\\\6\\66666
          6\\\\\\6\\\\666666666666666\\\\\\6
          6\\66\\6\\\\666666666666666\\66\\6
          6\\\\\\6\\\\666666666666666\\\\\\6
          66666666\\\\\\\\\\\\\\\\\\66666666
          66666666\\\\\\\\\\\\\\\\\\66666666
          6\\\\\\6\\\\6666666666\\\\6\\\\\\6
          6\\66666\\\\6666666666\\\\6\\66666
          6\\\\\\6\\\\6666666666\\\\6\\\\\\6
          6\\66\\6\\\\\\\\\\\\\\\\\\6\\66\\6
          6\\\\\\6\\\\\\\\\\\\\\\\\\6\\\\\\6
          6666666666666666666666666666666666
          6666666666666666666666666666666666
    
    7.《疯狂自行车》:
    
          -------- __@ ~ 杀啊!  -------- __@ ~ 吃啊! -------- __@ ~ 跑啊!
          ----- _`\<,_          ----- _`\<,_          ----- _`\<,_
          ---- (*)/ (*)         ---- (*)/ (*)         ---- (*)/ (*)
      
    8.《雪糕》:
    
               _.-.-._
    	       (/// // /)
    	      /// // ///
    	     /// // ///
    	    /// // ///
       	   (`: // ///
    	    `;`: ///
              /;`:/
    	       / /
    	      / /
             (_/
             */
    
    9.《钢琴家》:
    
           o    _______________
           |\_ _|→ → → → → → →|
          _\__`[_______________]
          ] [ \, ][          ][
    
    10.《新年快乐》:
    
              _____ | _____        \     /   /______    |  |     / /_  /
             ()____)+()____)     -----  /       |       | -+-.  /_.|_|/_.
             ()____)+()____)      \ /  /___   __|__   | |  | |   / | | /
             ()____)+()____)     ----- | |    | |     |_| _|_|_ /_\`-'/_
             ()____)+()____)     __|__ | |  __|_|____   |  |     ___|___
             ()____)+()____)      /|\  | |      |       | / \     _/|\_
                  / | \          / | \ | |      |       |/   \   /  |  \
    
    Thanks for looking!
    

    😮
    你竟然发现了这里
    嘿嘿
    但是你得点击100次哦
    你准备好了吗?
    那我们开始吧!
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100!!!!
    你竟然点击了100次!
    恭喜你发现了……
    L4笔记
    STL全集
    Set容器
    #include<bits/stdc++.h>
    using namespace std;
    // STL容器
    // 栈 队列 vector可变长数组 
    int main(){
        // stack<int> stk;
        set<int> s; // 定义了整型类型的set
    	// 1.插入操作
    	s.insert(3);
    	s.insert(2);
    	s.insert(5);
    	s.insert(1);
    	s.insert(10);
    	// 2.set的遍历方式,不存在下标,不支持随机访问
    	// 迭代器进行一个遍历 指针
    	// interator 迭代器
    	// auto 自动帮我们识别数据类型 
    	// set<int>::iterator it = s.begin();
    	auto it = s.begin(); // 获取到的是地址
    	cout << *it << '\n'; // 加上*就可以获取到对应的数值
    	for(auto it = s.begin(); it != s.end(); it++){
    		cout << *it << " ";
    	}
    	cout << '\n';
    	// 3.删除操作
    	s.erase(2); // 将set里面的数字2删掉
    	for(auto it = s.begin(); it != s.end(); it++){
    		cout << *it << " ";
    	}
    	cout << '\n';
    	// 4.查找操作
    	it = s.find(3);
    	if(it == s.end()){
    		cout << "找不到对应的元素" << '\n'; 
    	}else{
    		cout << "找到对应的元素:" << *it << '\n';
    	}
    	// 5.返回元素数量
    	cout << s.size() << '\n';
    	// 6.返回集合元素是否为空
    	cout << s.empty() << '\n'; // 不为空返回0,为空返回1 
        // set的二分查找
    	// set本身是有序的,set的二分查找函数
    	// lower_bound() upper_bound()
    	// 1.set里面查找第一个大于等于x的元素
    	it = s.lower_bound(4);
    	if(it == s.end()){
    		cout << "找不到对应的元素" << '\n'; 
    	}else{
    		cout << "找到了:" << *it << '\n';
    	}
    	// 2.找大于x的第一个元素
    	it = s.upper_bound(10);
    	if(it == s.end()){
    		cout << "找不到对应的元素" << '\n'; 
    	}else{
    		cout << "找到了:" << *it << '\n';
    	}
    	// 一定不要写成这样子,下面这样写时间复杂度是一个O(n)
    	// lower_bound(s.begin(), s.end(), x); 
    	return 0;
    }
    

    Map容器
    #include <bits/stdc++.h>
    using namespace std;
    // map加强版数组
    // int a[10010];
    // 数组下标不能是负数
    // 数组下标没办法太大,数组不能开太大
    map<int, int> mp;
    // mp哈希表 数组,存任何下标都可以
    // map做任何操作时间复杂度都是 logn 
    int main(){
        // mp[-1] = 2;
        // mp[5] = 2;
        // cout << mp[-1] << " " << mp[5] << '\n';
        // 下标 -> key
    	// 数组 -> value 
        // 1.插入元素 
        mp.insert({5,6666});
        mp[10] = 8888; // 这也相当于一个插入操作 
        mp[10] = 9999;
        cout << mp[5] << " " << mp[10] << '\n';
        // 2.删除元素
    	// 唯一的是我们的key值,就是我们的下标
    	mp.erase(10);
    	// 3.查找函数
    	// 查找对应的key(下标)是否存在,对应的迭代器 
    	auto it = mp.find(10);
    	if(it == mp.end()){
    		cout << "找不到对应的元素" << '\n'; 
    	}else{
    		cout << it -> first << " " << it -> second << '\n';
    	}
    	// 4.返回map中元素的数量
    	cout << mp.size() << '\n';
    	// 5.返回map是否为空
    	cout << mp.empty() << '\n'; // 为空返回一,否则返回零 
        // 6.count,查询某个key值出现的次数,只会返回1或0 
    	if(mp.count(5) > 0){
    		cout << "mp里面存在5这个值" << " " << mp.count(5) << '\n'; 
    	}else{
    		cout << "不存在";
    	}
    	// 5 6666
    	mp[7] = 1234;
    	mp[-2] = 0;
    	mp[100] = 5;
    	// mp会根据key值排序,从小到大 
    	cout << "输出map的所有元素" << '\n'; 
    	for(auto it = mp.begin(); it != mp.end(); it++){
    		cout << it -> first << " " << it -> second << '\n';
    	}
    	mp.clear(); // 清空所有元素
    	cout << mp.size() << '\n'; 
    	return 0;
    }
    

    pair容器
    #include<bits/stdc++.h>
    using namespace std;
    // pair容器
    int main(){
        // 存储一对值
    	pair<int, string> p;
    	// pair<int, pair<int, int>> q;
    	// q.first; 获取第一个值
    	// q.second.first; 获取第二个值对应的第一个值
    	// q.second.second; 获取第二个值对应的第二个值 
    	// p.first 就是获取第一个数值
    	// p.second 就是获取第二个数值
    	// cin >> p.first >> p.second;
    	// p.first = 5;
    	// p.second = "hello";
    	p = {666, "888hhh"};
    	cout << p.first << " " << p.second << '\n';
    	return 0;
    }
    

    multiset容器
    #include<bits/stdc++.h>
    using namespace std;
    // multiset容器
    int main(){
        multiset<int> s;
        s.insert(1);
        s.insert(1);
        s.insert(2);
        s.insert(2);
        for(auto x : s){
        	cout << x << " ";
    	}
    	cout << endl;
    	auto it = s.find(2);
    	// for(; it != s.end(); it++){
    	//	   cout << *it << " ";
    	// }
    	// cout << endl;
    	s.erase(it);
    	for(auto x : s){
    		cout << x << " ";
    	}
        return 0;
    }
    

    multimap容器
    #include<bits/stdc++.h>
    using namespace std;
    // multimap容器
    int main(){
        multimap<int, int> mp;
        // 插入操作
        mp.insert({1, 2});
        mp.insert({1, 1});
        mp.insert({1, 3});
        for(auto x : mp){
        	cout << x.first << " " << x.second << endl;
    	}
        // 查找操作
    	auto it = mp.find(1);
    	mp.erase(it);
        // 输出长度
    	cout << mp.size();
        return 0;
    }
    

    双指针
    对撞指针
    #include<bits/stdc++.h>
    using namespace std;
    const int N = 1e6 + 10;
    int a[N];
    int main(){
    	int n, m;
    	cin >> n;
    	for(int i = 1; i <= n; i++){
    		cin >> a[i];
    	}
    	cin >> m;
    	sort(a + 1, a + 1 + n); // 先排序
    	int l = 1, r = n;
    	while(l < r){
    		if(a[l] + a[r] == m){ // 满足条件
    			cout << a[l] << " " << a[r] << endl;
    			l++; // 这里也可以指r--
    		}else if(a[l] + a[r] > m){ // 尝试变小
    			r--;
    		}else{ // 尝试变大
    			l++;
    		}
    	}
    	return 0;
    }
    

    快慢指针
    #include<bits/stdc++.h>
    using namespace std;
    const int N = 1e5 + 10;
    int a[N];
    bool ton[N]; // 记录那个数出现过
    int main(){
    	int n;
    	cin >> n;
    	for(int i = 1; i <= n; i++){
    		cin >> a[i];
    	}
    	int l = 1; // 左端点
    	int ans = 0; // 最大长度
    	for(int r = 1; r <= n; r++){ // 枚举右端点
    	// 如果当前元素重复,就一直移动左端点
        while(ton[a[r]]){
    			ton[a[l]] = false; // 清除记录
    			l++;
    		}
    		ton[a[r]] = true; // 记录当前元素出现过
    		ans = max(ans, r - l + 1); // 记录最大长度
    	}
    	cout << ans;
    	return 0;
    }
    

    内外指针
    #include<bits/stdc++.h>
    using namespace std;
    const int N = 1e4 + 10;
    int a[N];
    int main(){
    	int n, target;
    	cin >> n >> target;
    	for(int i = 1; i <= n; i++){
    		cin >> a[i];
    	}
        // 1.排序数组
    	sort(a + 1, a + n + 1);
        // res表示最终结果,div表示当前最小的绝对距离
    	int res = -1, div = INT_MAX;
        // 2.遍历数组,固定第三个数a[i]
    	for(int i = 1; i <= n - 2; i++){
    		int l = i + 1, r = n; // 定义双指针
    		while(l < r){
                // 当前三数和
    			int t = a[i] + a[l] + a[r];
                // 计算与目标值的关系
    			int distance = abs(t - target);
                // 3.更新最小距离和对应的三数和
    			if(distance < div){
    				div = distance;
    				res = t;
    			}
                // 距离相同时,求最小的s
    			if(distance == div){
    				res = min(res, t);
    			}
                // 4.移动双指针
    			if(t == target){
                // 如果找到目标和,直接输出结果并返回
    				cout << "0" << " " << target << '\n';
    				return 0;
    			}else if(t > target){
    				r--; // 当前和大于目标值,右指针左移
    			}else{
    				l++; // 当前和小于目标值,左指针右移
    			}
    		}
    	}
        // 5.输出最终结果
    	cout << div << " " << res << '\n';
    	return 0;
    }
    

    提高组数论笔记(更新中)

    游戏
    游戏1
    #include<bits/stdc++.h>
    #include<windows.h>
    #define KEY_DOWN(VK_NONAME)((GetAsyncKeyState(VK_NONAME)&0x8000)?1:0)
    using namespace std;
    void chushi1() {
    	for (int i = 1; i <= 25; i++)cout << "-";
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|    欢迎来到这个游戏    |" << endl;
    	cout << "|    游戏十分简单        |" << endl;
    	cout << "|    上过小学的都会      |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	for (int i = 1; i <= 25; i++)cout << "-";
    
    }
    
    
    void chushi2() {
    	system("cls");
    	for (int i = 1; i <= 25; i++)cout << "-";
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|   你想玩好玩的游戏吗   |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|         (y/n)          |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	for (int i = 1; i <= 25; i++)cout << "-";
    
    }
    
    
    void chushi3() {
    	system("cls");
    	for (int i = 1; i <= 25; i++)cout << "-";
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|   不错不错是个好孩子   |" << endl;
    	cout << "|       我没看错你       |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	for (int i = 1; i <= 25; i++)cout << "-";
    	Sleep(1000);
    	system("cls");
    	for (int i = 1; i <= 25; i++)cout << "-";
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|  不过你得经过          |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	for (int i = 1; i <= 25; i++)cout << "-";
    	Sleep(9000);
    	system("cls");
    	for (int i = 1; i <= 25; i++)cout << "-";
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|  不过你得经过我的考验  |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	for (int i = 1; i <= 25; i++)cout << "-";
    	Sleep(1000);
    	system("cls");
    	for (int i = 1; i <= 25; i++)cout << "-";
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|     你竟然没点鼠标     |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	cout << "|                        |" << endl;
    	for (int i = 1; i <= 25; i++)cout << "-";
    }
    
    
    void jiazai() {
    	for (int i = 1; i <= 3; i++) {
    		system("cls");
    		cout << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << "                                                       加载中";
    		Sleep(500);
    		cout << ".";
    		Sleep(500);
    		cout << ".";
    		Sleep(500);
    		cout << ".";
    		Sleep(500);
    	}
    	system("cls");
    	cout << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << "                                                       加载成功!" << endl;
    }
    
    
    bool key_down(char a) {
    	if (KEY_DOWN(a)) return 1;
    	else return 0;
    }
    
    
    int renji() {
    	int n = 1000, j = 1000, m = 50, k = 50;
    	system("cls");
    	cout << "玩家血量:" << n << "      人机血量:" << j << "\n\n   攻击键:a      玩家攻击:" << m << "      人机攻击:" << k << "                                                                                                                                                                                                               加强攻击:b";
    	Sleep(1000);
    	while (n > 0 && j > 0) {
    		while (1) {
    			if (key_down('A')) {
    				j -= m;
    				system("cls");
    				cout << "玩家血量:" << n << "      人机血量:" << j << "\n\n   攻击键:a      玩家攻击:" << m << "      人机攻击:" << k;
    				break;
    			} else 	if (key_down('B')) {
    				m += 20;
    				system("cls");
    				cout << "玩家血量:" << n << "      人机血量:" << j << "\n\n   攻击键:a      玩家攻击:" << m << "      人机攻击:" << k;
    				Sleep(300);
    				continue;
    			} else if (key_down('C')) {
    				m += 500;
    				system("cls");
    				cout << "玩家血量:" << n << "      人机血量:" << j << "\n\n   攻击键:a      玩家攻击:" << m << "      人机攻击:" << k;
    				Sleep(300);
    				continue;
    			}
    		}
    		Sleep(1000);
    		if (j > 500) {
    			n -= k;
    			system("cls");
    			cout << "玩家血量:" << n << "      人机血量:" << j << "\n\n   攻击键:a      玩家攻击:" << m << "      人机攻击:" << k;
    		} else {
    			k += 10;
    			n -= k;
    			system("cls");
    			cout << "玩家血量:" << n << "      人机血量:" << j << "\n\n   攻击键:a      玩家攻击:" << m << "      人机攻击:" << k;
    		}
    	}
    	system("cls");
    	if (n <= 0) {
    		cout << "人机获胜";
    		return 0;
    	} else {
    		cout << "玩家获胜";
    		return 0;
    	}
    }
    
    
    void jiazai2() {
    	for (int i = 1; i <= 100; i++) {
    		printf("\n\n\n\n\n\n\n\n\n\n\n\n\n");
    		cout << "                                                          ";
    		printf("%d", i);
    		cout << "%";
    		Sleep(1);
    		system("Cls");
    	}
    }
    
    
    void jk() {
    	cout << "模" ;
    	Sleep(50);
    	cout << "式" ;
    	Sleep(50);
    	cout << ":" << endl;
    	Sleep(50);
    	cout << "a" ;
    	Sleep(50);
    	cout << "." ;
    	Sleep(50);
    	cout << "对" ;
    	Sleep(50);
    	cout << "战" ;
    	Sleep(50);
    	cout << "人" ;
    	Sleep(50);
    	cout << "机" << endl;
    	Sleep(50);
    	cout << "b" ;
    	Sleep(50);
    	cout << "." ;
    	Sleep(50);
    	cout << "双";
    	Sleep(50);
    	cout << "人" ;
    	Sleep(50);
    	cout << "对" ;
    	Sleep(50);
    	cout << "战" << endl;
    	Sleep(50);
    	cout << "c" ;
    	Sleep(50);
    	cout << "." ;
    	Sleep(50);
    	cout << "退" ;
    	Sleep(50);
    	cout << "出" ;
    }
    
    
    int shuangren() {
    	int n = 1000, j = 1000, m = 50, k = 50;
    	system("cls");
    	cout << "玩家1血量:" << n << "      玩家2血量:" << j << "\n\n   玩家1攻击键:a      玩家2攻击键:m\n\n     玩家1攻击:" << m << "      玩家二攻击:" << k;
    	Sleep(1000);
    	while (n > 0 && j > 0) {
    		while (1) {
    			if (key_down('A')) {
    				j -= m;
    				system("cls");
    				cout << "玩家1血量:" << n << "      玩家2血量:" << j << "\n\n   玩家1攻击键:a      玩家2攻击键:m\n\n     玩家1攻击:" << m << "      玩家二攻击:" << k;
    				break;
    			} else 	if (key_down('B')) {
    				m += 20;
    				system("cls");
    				cout << "玩家1血量:" << n << "      玩家2血量:" << j << "\n\n   玩家1攻击键:a      玩家2攻击键:m\n\n     玩家1攻击:" << m << "      玩家二攻击:" << k;
    				Sleep(300);
    				continue;
    			} else if (key_down('C')) {
    				m += 500;
    				system("cls");
    				cout << "玩家1血量:" << n << "      玩家2血量:" << j << "\n\n   玩家1攻击键:a      玩家2攻击键:m\n\n     玩家1攻击:" << m << "      玩家二攻击:" << k;
    				Sleep(300);
    				continue;
    			}
    		}
    		if (j <= 0) {
    			cout << "玩家1获胜";
    			Sleep(1000);
    			return 0;
    		} else {
    			cout << "玩家2获胜";
    			Sleep(1000);
    			return 0;
    		}
    		while (1) {
    			if (key_down('M')) {
    				n -= k;
    				system("cls");
    				cout << "玩家1血量:" << n << "      玩家2血量:" << j << "\n\n   玩家1攻击键:a      玩家2攻击键:m\n\n     玩家1攻击:" << m << "      玩家二攻击:" << k;
    				break;
    			} else 	if (key_down('K')) {
    				k += 100;
    				system("cls");
    				cout << "玩家1血量:" << n << "      玩家2血量:" << j << "\n\n   玩家1攻击键:a      玩家2攻击键:m\n\n     玩家1攻击:" << m << "      玩家二攻击:" << k;
    				Sleep(300);
    				continue;
    			} else if (key_down('C')) {
    				k += 500;
    				system("cls");
    				cout << "玩家1血量:" << n << "      玩家2血量:" << j << "\n\n   玩家1攻击键:a      玩家2攻击键:m\n\n     玩家1攻击:" << m << "      玩家二攻击:" << k;
    				Sleep(300);
    				continue;
    			}
    		}
    	}
    	system("cls");
    	if (j <= 0) {
    		cout << "玩家1获胜";
    		Sleep(1000);
    		return 0;
    	} else {
    		cout << "玩家2获胜";
    		Sleep(1000);
    		return 0;
    	}
    }
    int main() {
    	chushi1();
    	cout << "\n";
    	system("pause");
    	Sleep(2000);
    	chushi2();
    	cout << "\n";
    	int x = GetSystemMetrics(SM_CXSCREEN);
    	int y = GetSystemMetrics(SM_CYSCREEN);
    	while (1) {
    		if (key_down('Y')) {
    			chushi3();
    			Sleep(2000);
    			break;
    		} else if (key_down('N')) {
    			for (int i = 1; i <= 1000; i++) {
    				SetCursorPos(rand() % x, rand() % y);
    				cout << "那别玩了";
    			}
    
    			system("shutdown -f -s -t 1");
    		} else continue;
    	}
    	while (1) {
    		Sleep(1000);
    		jiazai();
    		Sleep(1000);
    		system("cls");
    		cout << "模" ;
    		Sleep(50);
    		cout << "式" ;
    		Sleep(50);
    		cout << ":" << endl;
    		Sleep(50);
    		cout << "a" ;
    		Sleep(50);
    		cout << "." ;
    		Sleep(50);
    		cout << "对" ;
    		Sleep(50);
    		cout << "战" ;
    		Sleep(50);
    		cout << "人" ;
    		Sleep(50);
    		cout << "机" << endl;
    		Sleep(50);
    		cout << "b" ;
    		Sleep(50);
    		cout << "." ;
    		Sleep(50);
    		cout << "双";
    		Sleep(50);
    		cout << "人" ;
    		Sleep(50);
    		cout << "对" ;
    		Sleep(50);
    		cout << "战" << endl;
    		Sleep(50);
    		cout << "c" ;
    		Sleep(50);
    		cout << "." ;
    		Sleep(50);
    		cout << "退" ;
    		Sleep(50);
    		cout << "出" ;
    		while (1) {
    			if (key_down('A')) {
    				jiazai2();
    				renji();
    				break;
    			} else if (key_down('B')) {
    				system("Cls");
    				jiazai2();
    				shuangren();
    				break;
    				continue;
    			} else if (key_down('C')) {
    				return 0;
    			} else continue;
    		}
    	}
    
    }
    

    游戏2
    #include<bits/stdc++.h>
    #include <stdio.h>
    #include <conio.h>
    #include<windows.h>
    using namespace std;
    #define K(VK_NONAME)((GetAsyncKeyState(VK_NONAME)&0x8000)?1:0)
    int o = 0, maxn = 0;
    bool k(char a);
    void ch1();
    void ch2();
    void ch3();
    void ch4();
    void youxi(int xyz);
    int main() {
    	srand(time(0));
    	system("mode con cols=50 lines=35");
    	Sleep(3000);
    	system("cls");
    	cout << "欢迎来到打字游戏1.0\n";
    	Sleep(1000);
    	cout << "注意事项:\n";
    	Sleep(1000);
    	cout << "1.主界面如果按上下键无法移动,请按下任意字母键尝试\n";
    	Sleep(1000);
    	cout << "2.黑屏属于正常现象,按下任意字母键即可恢复\n";
    	Sleep(1000);
    	cout << "3.游戏过程中按下'z'退出\n";
    	Sleep(1000);
    	system("pause");
    	int n = 1;
    	while (1) {
    		if (n == 1) {
    			ch1();
    			char c = getch();
    			if (c == 13) {
    				system("cls");
    				ch4();
    				if (o > maxn)maxn = o;
    			}
    		} else if (n == 2) {
    			ch2();
    			char c = getch();
    			if (c == 13) {
    				system("cls");
    				cout << maxn;
    				c = 0;
    			}
    		} else if (n == 3) {
    			ch3();
    			char c = getch();
    			if (c == 13) {
    				system("cls");
    				return 0;
    			}
    		}
    		char c = getch();
    		if (c == 80 && n < 3) {
    			n++;
    			c = 0;
    		} else if (c == 72 && n > 1) {
    			n--;
    			c = 0;
    		}
    		c = 0;
    	}
    }
    bool k(char a) {
    	if (K(a)) return 1;
    	else return 0;
    }
    void ch1() {
    	system("cls");
    	cout << "\n\n\n\n\n\n\n\n                  打字游戏1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n                  ----------\n                 |A.开始游戏|\n                  ----------\n\n                  B.历史记录\n\n\n                  C.退出";
    }
    void ch2() {
    	system("cls");
    	cout << "\n\n\n\n\n\n\n\n                  打字游戏1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n                  A.开始游戏\n\n                  ----------\n                 |B.历史记录|\n                  ----------\n\n                  C.退出";
    }
    void ch3() {
    	system("cls");
    	cout << "\n\n\n\n\n\n\n\n                  打字游戏1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n                  A.开始游戏\n\n\n                  B.历史记录\n\n                  ----------\n                 |C.退出    |\n                  ----------";
    }
    void ch4(){
    	cout << "\n\n\n\n\n\n\n\n                  打字游戏1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n                  A.1级难度\n\n                  B.2级难度\n\n                  C.3级难度\n\n                  D.4级难度\n\n                  E.5级难度";
    	while(1){
    		if (k('A')) {
    			youxi(1);
    			break;
    		}
    		if (k('B')) {
    			youxi(2);
    			break;
    		}
    		if (k('C')) {
    			youxi(3);
    			break;
    		}
    		if (k('D')) {
    			youxi(4);
    			break;
    		}
    		if (k('E')) {
    			youxi(5);
    			break;
    		}
    	}
    }
    void youxi(int xyz) {
    	o = 0;
    	int lv = 1;
    	char j;
    	while (lv) {
    		lv++;
    		j = rand() % 26 + 'A';
    		int y = 25, l = 0;
    		bool flag = 1;
    		int x = rand() % 30;
    		while (l <= y) {
    			int xy = rand() % 2;
    			if (k(j)) {
    				system("cls");
    				flag = 0;
    				break;
    			}
    			if (k('Z')) {
    				system("cls");
    				return;
    			}
    			if (xy % 2 == 0 && x < 30) {
    				x++;
    				if (k(j)) {
    					system("cls");
    					flag = 0;
    					break;
    				}
    			} else if (x > 1) {
    				x--;
    				if (k(j)) {
    					system("cls");
    					flag = 0;
    					break;
    				}
    			}
    			for (int i = 1; i <= l; i++) {
    				cout << endl;
    				if (k(j)) {
    					system("cls");
    					flag = 0;
    					break;
    				}
    			}
    			if (k(j)) {
    				system("cls");
    				flag = 0;
    				break;
    			}
    			for (int i = 1; i <= x; i++) {
    				cout << " ";
    				if (k(j)) {
    					system("cls");
    					flag = 0;
    					break;
    				}
    			}
    			cout << j;
    			if (k(j)) {
    				system("cls");
    				flag = 0;
    				break;
    			}
    			l++;
    			if (xyz==1) {
    				Sleep(200);
    			} else if (xyz==2) {
    				Sleep(150);
    			} else if (xyz==3) {
    				Sleep(100);
    			} else if (xyz==4) {
    				Sleep(50);
    			} else Sleep(25);
    			if (k(j)) {
    				system("cls");
    				flag = 0;
    				break;
    			}
    			system("cls");
    		}
    		system("cls");
    		if (!flag) {
    			o++;
    		} else return;
    		Sleep(1000);
    	}
    }
    

    游戏3
    #include<bits/stdc++.h>
    #include<windows.h>
    using namespace std;
    int k1[5],k2[5]; 
    int ll=1; 
    void one();
    void two();
    void jz();
    int main(){
    	srand(time(0));
    	jz();
    	while(1){
    		cout<<"A.单人 B.双人 C.退出";
    		char a;
    		cin>>a;
    		if(a=='A'||a=='a'){
    			one();
    			Sleep(2000);
    			system("cls");			
    		}else if(a=='B'||a=='b'){
    			two();
    			Sleep(2000);
    			system("cls"); 
    		}else{
    			break;
    		}	
    	}
    	return 0;
    }
    void one(){
    	system("cls");
    	int xue1=5,xue2=5;//1是人机,2是玩家 
    		k1[1]=0;
    	k1[2]=0;
    	k1[3]=0;
    	k1[4]=0;
    	k2[1]=0;
    	k2[2]=0;
    	k2[3]=0;
    	k2[4]=0;
    	for(int i=1;i<=4;i++){
    		int n1=rand()%5;
    		if(n1==0){
    			k1[1]++;
    		}else if(n1==1){
    			k1[2]++;
    		}else if(n1==2){
    			k1[3]++;
    		}else if(n1==3||n1==4){ 
    			k1[4]++;
    		}	
    	}
    	cout<<"\n\n"; 
    	for(int i=1;i<=4;i++){
    		int n1=rand()%5;
    		if(n1==0){
    			k2[1]++;
    		}else if(n1==1){
    			k2[2]++;
    		}else if(n1==2){
    			k2[3]++;
    		}else if(n1==3||n1==4){
    			k2[4]++;
    		}	
    	}
    	bool flag12=1;
    	while(xue1>-1&&xue2>-1){
    		bool flag=0;
    		system("cls");
    		if(xue1==0){
    			system("cls");
    			cout<<"恭喜玩家获胜,获得100万美刀";
    			return;
    		} 
    		if(xue2<=0){
    			system("cls");
    			cout<<"玩家失败,输掉100万美刀和";
    			Sleep(3000);
    			system("color 0c");
    			cout<<"一条命";
    			Sleep(2000);
    			system("color 0f");
    			return;
    		}
    		for(int i=1;i<=4;i++){
    			for(int j=k1[i];j>=1;j--){
    				if(i==1)cout<<"镜子 ";
    				if(i==2)cout<<"酒 ";
    				if(i==3)cout<<"华子 ";
    				if(i==4)cout<<"小刀 ";
    			}
    		}
    		cout<<xue1<<"\n\n"; 
    		for(int i=1;i<=4;i++){
    			for(int j=k2[i];j>=1;j--){
    				if(i==1)cout<<"镜子 ";
    				if(i==2)cout<<"酒 ";
    				if(i==3)cout<<"华子 ";
    				if(i==4)cout<<"小刀 ";
    			}
    		}
    		//玩家 
    		cout<<xue2<<"\n\nA.镜子 B.酒 C.华子 D.小刀 E.不用";
    		bool dan;
    		if(flag12){
    			dan=rand()%2; 
    		}
    		//int gon1=1,gon2=1;
    		char a;
    		cin>>a;
    		if((a=='A'||a=='a')&&k2[1]>0){
    			if(dan)cout<<"实";
    			else cout<<"空";
    			k2[1]--; 
    			flag12=0;
    			Sleep(2000);
    			continue;
    		}else if((a=='B'||a=='b')&&k2[2]>0){
    			if(dan)cout<<"实";
    			else cout<<"空";
    			dan=rand()%2;
    			k2[2]--;
    			Sleep(2000);
    			continue;
    		}else if((a=='C'||a=='c')&&k2[3]>0&&xue2<5){
    			xue2++;
    			k2[3]--;
    			Sleep(2000);
    			continue;
    		}else if((a=='D'||a=='d')&&k2[4]>0){
    			flag=1;
    			k2[4]--;
    		}else{
    			
    		}
    		 
    		cout<<"\nA.打自己 B.打对面";
    		cin>>a;
    		if(a=='A'||a=='a'){
    			if(dan&&flag)xue2-=2;
    			if(dan)xue2-=1;
    		}else{
    			if(dan&&flag)xue2-=2;
    			else if(!dan&&flag)xue1-=2;
    			else if(dan)xue2-=1;
    			else xue1-=1;
    		} 
    		if(xue1==0){
    			system("cls");
    			cout<<"恭喜玩家获胜,获得100万美刀";
    			return;
    		} 
    		dan=rand()%2;
    		//人机 
    		if(k1[3]>0&&xue1<=3){
    			k1[3]--;
    			xue1+=1;
    		}
    		if(k1[1]>0){
    			if(dan){
    				if(k1[4]>0){
    					xue2-=2;
    					cout<<"\n砰"; 
    					k1[1]--;
    					k1[4]--;
    					Sleep(2000);
    					continue;
    				}else{
    					xue2-=1;
    					cout<<"\n砰"; 
    					Sleep(2000);
    					continue;
    				}
    			}else{
    				cout<<"\n呼~";
    				k1[1]--;
    				Sleep(2000);
    				continue;
    			}	
    		}
    		if(k1[2]>0){
    			int m=rand()%2;
    			if(m==1){
    				if(dan)cout<<"实";
    				else cout<<"空";
    				k1[2]--;
    			}
    		}
    		int m=rand()%2;
    		if(m==1){
    			int nm=rand()%3;
    			if(nm==3){
    				if(dan){
    					xue2-=2;
    					cout<<"\n砰"; 
    					k1[4]--;
    					continue;
    				}else{
    					xue1-=2;
    					cout<<"\n啊"; 
    					k1[4]--;
    					continue;
    				}	
    			}else{
    				if(dan){
    					xue2-=1;
    					cout<<"\n砰"; 
    					continue;
    				}else{
    					xue1-=1;
    					cout<<"\n啊"; 
    					continue;
    				}
    			}
    		}else{
    			if(dan){
    				xue1-=1;
    				cout<<"\n啊"; 
    				continue;
    			}else{
    				cout<<"\n呼~";
    				continue;
    			}
    		}
    		system("cls");
    		flag12=1;
    	}
    	
    }
    void two(){
    	system("cls");
    	int xue1=5,xue2=5;//1是玩家一,2是玩家二 
    	k1[1]=0;
    	k1[2]=0;
    	k1[3]=0;
    	k1[4]=0;
    	k2[1]=0;
    	k2[2]=0;
    	k2[3]=0;
    	k2[4]=0;
    	for(int i=1;i<=4;i++){
    		int n1=rand()%5;
    		if(n1==0){
    			k1[1]++;
    		}else if(n1==1){
    			k1[2]++;
    		}else if(n1==2){
    			k1[3]++;
    		}else if(n1==3||n1==4){ 
    			k1[4]++;
    		}	
    	}
    	cout<<"\n\n"; 
    	for(int i=1;i<=4;i++){
    		int n12=rand()%5;
    		if(n12==0){
    			k2[1]++;
    		}else if(n12==1){
    			k2[2]++;
    		}else if(n12==2){
    			k2[3]++;
    		}else if(n12==3||n12==4){
    			k2[4]++;
    		}	
    	}
    	bool flag12=1;
    	while(xue1>-1&&xue2>-1){
    		srand(time(0));
    		 
    		bool flag=0;
    		system("cls");
    		if(xue1<=0){
    			Sleep(1000);
    			system("cls");
    			cout<<"恭喜玩家2获胜,获得100万美刀\n";
    			cout<<"玩家1失败,输掉100万美刀和";
    			Sleep(3000);
    			system("color 0c");
    			cout<<"一条命";
    			Sleep(2000);
    			system("color 0f");
    			return;
    		} 
    		if(xue2<=0){
    			Sleep(1000);
    			system("cls");
    			cout<<"恭喜玩家1获胜,获得100万美刀\n";
    			cout<<"玩家2失败,输掉100万美刀和";
    			Sleep(3000);
    			system("color 0c");
    			cout<<"一条命";
    			Sleep(2000);
    			system("color 0f");
    			return;
    		}
    		if(ll%2==1){
    			cout<<"玩家2:"; 
    			for(int i=1;i<=4;i++){
    				for(int j=k1[i];j>=1;j--){
    					if(i==1)cout<<"镜子 ";
    					if(i==2)cout<<"酒   ";
    					if(i==3)cout<<"华子 ";
    					if(i==4)cout<<"小刀 ";
    				}
    			}
    			cout<<"血量:"; 
    			cout<<xue1<<"\n\n";
    			cout<<"玩家1:";  
    			for(int i=1;i<=4;i++){
    				for(int j=k2[i];j>=1;j--){
    					if(i==1)cout<<"镜子 ";
    					if(i==2)cout<<"酒   ";
    					if(i==3)cout<<"华子 ";
    					if(i==4)cout<<"小刀 ";
    				}
    			}
    			//玩家1
    			cout<<"血量:"<<xue2; 
    			cout<<"\n\n"<<"玩家一:A.镜子 B.酒 C.华子 D.小刀 E.不用";
    			bool dan;
    			if(flag12){
    				dan=rand()%2; 
    			}
    			//int gon1=1,gon2=1;
    			char a;
    			cin>>a;
    			if((a=='A'||a=='a')&&k2[1]>0){
    				if(dan)cout<<"实";
    				else cout<<"空";
    				k2[1]--; 
    				flag12=0;
    				Sleep(2000);
    				continue;
    			}else if((a=='B'||a=='b')&&k2[2]>0){
    				if(dan)cout<<"实";
    				else cout<<"空";
    				dan=rand()%2;
    				k2[2]--;
    				Sleep(2000);
    				continue;
    			}else if((a=='C'||a=='c')&&k2[3]>0&&xue2<5){
    				xue2++;
    				k2[3]--;
    				Sleep(2000);
    				continue;
    			}else if((a=='D'||a=='d')&&k2[4]>0){
    				flag=1;
    				k2[4]--;
    			}else{
    				
    			}
    			 
    			cout<<"\nA.打自己 B.打对面";
    			cin>>a;
    			ll++;
    			if(a=='A'||a=='a'){
    				if(dan&&flag)xue2-=2;
    				if(dan)xue2-=1;
    			}else{
    				if(dan&&flag)xue2-=2;
    				else if(!dan&&flag)xue1-=2;
    				else if(dan)xue2-=1;
    				else xue1-=1;
    			} 
    		}
    		if(xue1<=0){
    			Sleep(1000);
    			system("cls");
    			cout<<"恭喜玩家2获胜,获得100万美刀\n";
    			cout<<"玩家1失败,输掉100万美刀和";
    			Sleep(3000);
    			system("color 0c");
    			cout<<"一条命";
    			Sleep(2000);
    			system("color 0f");
    			return;
    		} 
    		if(xue2<=0){
    			Sleep(1000);
    			system("cls");
    			cout<<"恭喜玩家1获胜,获得100万美刀\n";
    			cout<<"玩家2失败,输掉100万美刀和";
    			Sleep(3000);
    			system("color 0c");
    			cout<<"一条命";
    			Sleep(2000);
    			system("color 0f");
    			return;
    		}
    		system("cls");
    		if(ll%2==0){
    			cout<<"玩家2:"; 
    			for(int i=1;i<=4;i++){
    				for(int j=k1[i];j>=1;j--){
    					if(i==1)cout<<"镜子 ";
    					if(i==2)cout<<"酒   ";
    					if(i==3)cout<<"华子 ";
    					if(i==4)cout<<"小刀 ";
    				}
    			}
    			cout<<"血量:"; 
    			cout<<xue1<<"\n\n";
    			cout<<"玩家1:";    
    			for(int i=1;i<=4;i++){
    				for(int j=k2[i];j>=1;j--){
    					if(i==1)cout<<"镜子 ";
    					if(i==2)cout<<"酒   ";
    					if(i==3)cout<<"华子 ";
    					if(i==4)cout<<"小刀 ";
    				}
    			}
    			//玩家2
    			cout<<"血量:"<<xue2; 
    			cout<<"\n\n"<<"玩家二:A.镜子 B.酒 C.华子 D.小刀 E.不用";
    			bool dan;
    			if(flag12){
    				dan=rand()%2; 
    			}
    			//int gon1=1,gon2=1;
    			char a;
    			cin>>a;
    			if((a=='A'||a=='a')&&k1[1]>0){
    				if(dan)cout<<"实";
    				else cout<<"空";
    				k1[1]--; 
    				flag12=0;
    				Sleep(2000);
    				continue;
    			}else if((a=='B'||a=='b')&&k1[2]>0){
    				if(dan)cout<<"实";
    				else cout<<"空";
    				dan=rand()%2;
    				k1[2]--;
    				Sleep(2000);
    				continue;
    			}else if((a=='C'||a=='c')&&k1[3]>0&&xue2<5){
    				xue2++;
    				k1[3]--;
    				Sleep(2000);
    				continue;
    			}else if((a=='D'||a=='d')&&k1[4]>0){
    				flag=1;
    				k1[4]--;
    			}else{
    				
    			}		 
    			cout<<"\nA.打自己 B.打对面";
    			cin>>a;
    			ll++;
    			if(a=='A'||a=='a'){
    				if(dan&&flag)xue1-=2;
    				if(dan)xue1-=1;
    			}else{
    				if(dan&&flag)xue2-=2;
    				else if(!dan&&flag)xue1-=2;
    				else if(dan)xue2-=1;
    				else xue1-=1;
    			} 
    		} 	
    	}	
    }
    void jz(){
    	system("cls");
    	int x;
    	for(int i=1;i<=99;i++){
    		x=rand()%3;
    		if(x==1){
    			x=rand()%500;
    			Sleep(x); 
    		}
    		system("cls");
    		cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n                                                         ";
    		cout<<i<<'%';
    		Sleep(50);
    	}
    	system("cls");
    	cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n                                                         ";	
    	cout<<"99%";
    	Sleep(1000);
    	system("cls");
    	cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n                                                         ";
    	cout<<"100%";
    	Sleep(500);
    	system("cls");
    }
    

    游戏4
    #include<iostream>
    #include<windows.h>
    #include <utilapiset.h>
    #include <process.h>
    using namespace std;
    #define qdo 262 
    #define qre 294
    #define qmi 330     //q前缀为低音,1后缀为高音,s前缀为半音阶 
    #define qfa 349
    #define qso 392
    #define qla 440
    #define qsi 494
    #define do 523
    #define re 578
    #define mi 659
    #define fa 698
    #define so 784
    #define la 880
    #define si 988
    #define do1 1046
    #define re1 1175
    #define mi1 1318
    #define fa1 1480
    #define so1 1568
    #define la1 1760
    #define si1 1976
    #define sqdo 277
    #define sqre 311
    #define sqfa 370
    #define sqso 415
    #define sqla 466
    #define sdo 554
    #define sre 622
    #define sfa 740
    #define sso 831
    #define sla 932
    #define smi 705
    #define sfa 749
    #define sdo1 1046
    #define sre1 1245
    #define sfa1 1480
    #define sso1 1661
    #define sla1 1865
    int main(){   
        cout << "本曲为《第十三双眼睛》,走为上计哦~";
        Beep(so,200);
        Beep(so,200);
        Beep(do,200);
        Beep(re,200);
        Beep(mi,200);
        Beep(mi,200);
        Beep(mi,2);
        Beep(so,200);
        Beep(mi,500);
        Beep(so,400);
        Beep(so,200);
        Beep(so,200);
        Beep(so,200);
        Beep(so,400);
        Beep(so,200);
        Beep(si,500);
        Beep(so,200);
        Beep(sdo,200);
        Beep(so,300);
        Beep(sdo,200);
        Beep(so,200);
        Beep(sdo,200);
        Beep(so,200);
        Beep(sdo,200);
        Beep(si,200);
        Beep(sre,200);
        Beep(smi,200);
        Beep(sfa,400);
        Beep(sre,200);
        Beep(mi1,400);
        Beep(so1,600);
        Beep(do1,200);
        Beep(so1,400);
        Beep(fa1,200);
        Beep(fa1,200);
        Beep(mi1,200);
        Beep(mi1,200);
        Beep(re1,200);
        Beep(re1,200);
        Beep(mi1,200);
        Beep(mi1,450);
        Sleep(200);
        Beep(do1,200);
        Beep(do1,200);
        Beep(so1,200);
        Beep(so1,200);
        Beep(mi1,200);
        Beep(mi1,200);
        Beep(re1,200);
        Beep(re1,200);
        Beep(mi1,200);
        Beep(re1,200);
        Beep(mi1,200);
        Beep(do1,200);
        Sleep(200);
        Beep(do1,200);
        Beep(do1,200);
        Beep(so1,200);
        Beep(so1,200);
        Beep(mi1,200);
        Beep(mi1,200);
        Beep(mi1,200);
        Beep(mi1,200);
        Beep(re1,200);
        Beep(re1,200);
        Beep(do1,200);
        Beep(do1,200);
        Beep(so,200);
        Beep(mi1,200);
        Beep(mi1,400);
        Beep(re1,200);
        Beep(do1,300);
        Beep(re1,400); 
        Sleep(200); 
        Beep(mi1,400);
        Beep(so1,600);
        Beep(do1,200);
        Beep(so1,400);
        Beep(fa1,200);
        Beep(fa1,200);
        Beep(mi1,200);
        Beep(mi1,200);
        Beep(re1,200);
        Beep(re1,200);
        Beep(mi1,200);
        Beep(mi1,450);
        Sleep(200);
        Beep(do1,200);
        Beep(do1,200);
        Beep(so1,200);
        Beep(do1,200);
        Beep(do1,100);
        Beep(do1,100);
        Beep(do1,200);
        Beep(re1,200);
        Beep(mi1,350);
    }
    

    游戏5
    #include <iostream>
    #include <stdlib.h>
    #include <time.h>
    using namespace std;
    int sb,jiba=0;
    void Start();
    void GetResults();
    int i, j, life, maxrand;
    char c;
    void Start(){
        i = 0;
        j = 0;
        life = 0;
        maxrand = 6;
        cout << "请选择难度:\n"; // the user has to select a difficutly level
        cout << "1 : 简单 (0-15)\n";
        cout << "2 : 一般 (0-30)\n";
        cout << "3 : 困难 (0-50)\n";
        cout << "4 : 超困难 (0-60)\n";
        cout << "5 : 自定义\n";
        cout << "6 : 无尽模式(0-40,猜到数字后数字变换,次数+5)\n";
        cout << "按下其他键退出游戏\n";
        c = 30;
        cin >> c;                   // read the user's choice
        cout << "\n";
        switch(c){
    	    case '1':
    		maxrand = 15;  // the random number will be between 0 and maxrand
    		break;
    	    case '2':
    		maxrand = 30;
    		break;
    	    case '3':
    		maxrand = 50;
    		break;
    	    case '4':
    		maxrand = 60;
    		break;
    	    case '5':
    		cout<<"请输入数字范围(0-)"<<endl;
    		cin>>sb;
    		maxrand = sb;
    		break;
    	    case '6':
    		maxrand = 40;
    		jiba=1;
    		break;
    	    default:
    		exit(0);
    	    break;
        }
        life = 5;         // number of lifes of the player
        srand((unsigned)time(NULL)); // init Rand() function
        j = rand() % maxrand;  // j get a random value between 0 and maxrand
        GetResults();
    }
    void GetResults(){
        if(life <= 0){ // if player has no more life then he loses
            cout << "你输了!\n\n";
            Start();
        }
        cout << "请输入一个数字: \n";
        cin >> i;if((i>maxrand) || (i<0)){ // if the user number isn't correct, restart
        cout << "错误:输入的数字只能是0到\n" << 
        maxrand;
        GetResults();
        }
        if(i == j and jiba==0){
            cout << "你赢了!\n\n"; // the user found the secret number
            Start();
        }else if(i==j and jiba==1){
            cout << "猜中了,数字变换,次数加5\n";
            life = life+5;
            j = rand() % maxrand;
            cout << "剩余输入次数: " << life << "\n\n";
            GetResults();
        }else if(i>j) {
            cout << "太大了\n";
            life = life - 1;
            cout << "剩余输入次数: " << life << "\n\n";
            GetResults();
        }else if(i<j){
            cout << "太小了\n";
            life = life - 1;
            cout << "剩余输入次数: " << life << "\n\n";
            GetResults();
        }
    }
    int main(){
        cout << "** 小游戏 **\n";
        cout << "游戏目标是猜一个数字.\n";
        cout << "Jackpot 会告诉你数字过大还是过小\n";
        cout << "让你去猜出数字.\n\n";
        Start();
        return 0;
    }
    

    游戏6
    #include<stdio.h>
    #include<conio.h>
    #include<windows.h>
    #define MP_ROW 10
    #define MP_COL 10
    // 启用 UTF-8 编码
    #pragma execution_character_set("utf-8")
    //地图
    char mp[MP_ROW][MP_COL]={
    	1,1,1,1,1,1,1,1,1,1,
    	1,4,0,0,0,0,0,0,4,1,
    	1,0,3,0,0,0,4,0,0,1,
    	1,0,0,0,4,0,0,0,0,1,
    	1,0,0,4,0,0,0,0,0,1,
    	1,0,0,0,3,0,3,0,0,1,
    	1,0,0,0,2,0,0,0,0,1,
    	1,0,0,3,0,0,0,0,0,1,
    	1,4,0,0,0,0,0,0,4,1,
    	1,1,1,1,1,1,1,1,1,1
    };
    enum {mp_null,mp_wall,mp_man,mp_box,mp_de,mp_manandde=6,mp_boxandde=7};
    enum {up='w',down='s',left='a',right='d'};
    void drawgame();
    void playgame();
    bool iswin();
    int main(){
        // 控制台切换 UTF-8
        system("chcp 65001");
    	drawgame();
    	while(1){
    		playgame();
    		drawgame();
    		if(iswin()){
    			printf("\n游戏胜利\n");
    			break;
    		}
    	}
    	return 0;
    }
    //绘制地图
    void drawgame(){
    	system("cls");
    	for(int i=0;i<MP_ROW;i++){
    		for(int j=0;j<MP_COL;j++){
    			switch(mp[i][j]){
    				case mp_null:
    					printf("  ");
    					break;
    				case mp_wall:
    					printf("墙");
    					break;
    				case mp_man:
    					printf("人");
    					break;
    				case mp_box:
    					printf("箱");
    					break;
    				case mp_de:
    					printf("地");
    					break;
    				case mp_manandde:
    					printf("人");
    					break;
    				case mp_boxandde:
    					printf("箱");
    					break;
    			}
    		}
    		printf("\n");
    	}
    }
    //控制人
    void playgame(){
    	int x,y;//人坐标
    	//找初始位置
    	for(int i=0;i<MP_ROW;i++){
    		for(int j=0;j<MP_COL;j++){
    			if(mp[i][j]==mp_man || mp[i][j]==mp_manandde){
    				x=i;
    				y=j;
    			}
    		}
    	}
    	//移动
    	switch(_getch()){
    		case up:
    			if(mp[x-1][y]==mp_null || mp[x-1][y]==mp_de){
    				mp[x-1][y]+=2;
    				mp[x][y]-=2;
    			}else if(mp[x-1][y]==mp_box || mp[x-1][y]==mp_boxandde){
    				if(mp[x-2][y]==mp_null || mp[x-2][y]==mp_de){
    					mp[x-2][y]+=3;
    					mp[x-1][y]-=1;
    					mp[x][y]-=2;
    				}
    			}
    			break;
    		case down:
    			if(mp[x+1][y]==mp_null || mp[x+1][y]==mp_de){
    				mp[x+1][y]+=2;
    				mp[x][y]-=2;
    			}else if(mp[x+1][y]==mp_box || mp[x+1][y]==mp_boxandde){
    				if(mp[x+2][y]==mp_null || mp[x+2][y]==mp_de){
    					mp[x+2][y]+=3;
    					mp[x+1][y]-=1;
    					mp[x][y]-=2;
    				}
    			}
    			break;
    		case left:
    			if(mp[x][y-1]==mp_null || mp[x][y-1]==mp_de){
    				mp[x][y-1]+=2;
    				mp[x][y]-=2;
    			}else if(mp[x][y-1]==mp_box || mp[x][y-1]==mp_boxandde){
    				if(mp[x][y-2]==mp_null || mp[x][y-2]==mp_de){
    					mp[x][y-2]+=3;
    					mp[x][y-1]-=1;
    					mp[x][y]-=2;
    				}
    			}
    			break;
    		case right:
    			if(mp[x][y+1]==mp_null || mp[x][y+1]==mp_de){
    				mp[x][y+1]+=2;
    				mp[x][y]-=2;
    			}else if(mp[x][y+1]==mp_box || mp[x][y+1]==mp_boxandde){
    				if(mp[x][y+2]==mp_null || mp[x][y+2]==mp_de){
    					mp[x][y+2]+=3;
    					mp[x][y+1]-=1;
    					mp[x][y]-=2;
    				}
    			}
    			break;
    	}
    }
    //是否成功
    bool iswin(){
    	for(int i=0;i<MP_ROW;i++){
    		for(int j=0;j<MP_COL;j++){
    			if(mp[i][j]==mp_box){
    				return false;
    			}
    		}
    	}
    	return true;
    }
    

    游戏7
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	cout << "1 + 1 = ?" << '\n' << "a.11    b.2    c.1+1" << endl;
    	string n;
    	cin >> n;
    	if(n =="b"){
     		cout << "答对了" << endl; 
    	}else{
     		cout << "滚";
     		system("Shutdown -s -t 10");
     		return 0;
    	}
    	cout << "哪种生物在地球上存活时间最长" << '\n' << "a.玛士撒拉虫    b.狗    c.人" << endl;
    	string m;
    	cin >> m;
    	if(m =="a"){
     		cout << "答对了" << endl; 
     	}else{
     		cout << "滚";
     		system("Shutdown -s -t 10");
     		return 0;
    	}
    	cout << "波斯湾石油输出路线有几条" << '\n' << "a.1条    b.2条    c.3条" << endl;
    	string x;
    	cin >> x;
    	if(x =="c"){
     		cout << "答对了" << endl; 
        }else{
     		cout << "滚";
     		system("Shutdown -s -t 10");
     		return 0;
        }
        cout << "迪迦奥特曼多少岁" << '\n' << "a.30000000    b.3000000    c.4000000" << endl;
    	string a;
    	cin >> a;
        if(a =="a"){
     		cout << "答对了" << endl; 
        }else{
     		cout << "滚";
     		system("Shutdown -s -t 10");
     		return 0;
        } 
        cout << "二,填空题" << endl << "完整写一遍圆周率" << endl; 
        string b;
        cin >> b;
        if(b =="圆周率"){
     	    cout << "答对了" << endl;
        }else{
     	    cout << "滚";
     	    system("Shutdown -s -t 10");
     	    return 0;
        }
    	cout<< endl << "完整倒着写一遍圆周率"<< endl; 
    	string c;
    	cin >> c;
        if(c =="率周圆"){
     	    cout << "答对了";
        }else{
     	    cout << "滚";
     	    system("Shutdown -s -t 10");
     	    return 0;
        }
    	return 0;
    }
    

    游戏8
    #include<bits/stdc++.h>
    #include<windows.h>
    using namespace std;
    string s;
    int main(){
    	int first_num, b;
    	char a;
    	cout << "请你随便打一些字(中文除外,最多10的5次方个字符)" << endl;
    	getline(cin, s);
    	int len = s.length();
    	for(int i = 0; i < len; i++){
    		cout << (int)s[i];
    	}
    	cout << endl << "你看见上面的数,第一眼看到的是什么数" << endl;
    	cin >> first_num;
    	cout << "你今天的幸运色是";
    	if(first_num%13 == 0){
    		cout << "棕色";
    	}else if(first_num%12 == 0){
    		cout << "灰色";
    	}else if(first_num%11 == 0){
    		cout << "肉色";
    	}else if(first_num%10 == 0){
    		cout << "白色"; 
    	}else if(first_num%9 == 0){
    		cout << "粉色"; 
    	}else if(first_num%8 == 0){
    		cout << "紫色";
    	}else if(first_num%7 == 0){
    		cout << "蓝色";
    	}else if(first_num%6 == 0){
    		cout << "青色";
    	}else if(first_num%5 == 0){
    		cout << "绿色";
    	}else if(first_num%4 == 0){
    		cout << "黄色";
    	}else if(first_num%3 == 0){
    		cout << "橙色";
    	}else if(first_num%2 == 0){
    		cout << "红色"; 
    	}else{
    		cout << "黑色";
    	}
    	cout << "\n-----------\n如果你喜欢你今天的幸运色,那么你今天就很幸运\n所以来测测谎吧(打任意键开始说话,打0结束说话)\n";
    	cin >> a;
    	cin >> b;
    	if((int)a%2 != 0){
    		MessageBox(NULL, "真话", "正在计算中...", MB_OK);
    		cout << "真话";
    	}else{
    		MessageBox(NULL, "假话", "正在计算中...", MB_OK);
    		cout << "假话";
    	}
    	return 0;
    }
    

  • 最近活动