• 个人简介

    ip签名档论坛签名图片显示ip地址操作系统浏览器等信息

    @就是他把我的好多的游戏搬走了,比如火影,他还说是我抄他发布时间为2024年2月1日10点04分,如果发现他说我,请不要相信,他有可能捏造事实,如果他说他的时间更早,也不要相信,而且我先发布这些游戏,这点寒假集训强化班和冲刺班的人能做证

    可做证的人:

    @

    @

    以下文字可以点击(^_^)

    关于域

    -----------------------------

    我的域

    我建的域

    加一下吧

    求求了

    -----------------------------

    同学域

    同学建的域

    -----------------------------

    集训课堂笔记

    -----------------------------

    迭代器
    迭代器说白了就是类型
    支持随机访问迭代器:vector, array, deque
    双向迭代器:list,set/map
    容器类名::iterator 
    迭代器名vector<int>::iteratori;
    vector<char>::iterator j;
    list<node>::iterator q;
    遍历:普通(仅限数组)
    for(int i=0;i<n;i++)
    cout<<x[i]<<" ";
    遍历:STL(迭代器版,任何STL都行)
    for(vector<int>::iterator if = v.begin();if!=v.end();++it)
    cout<<*it<<' ';
    

    -----------------------------

    动态数组
    vector < 数据类型 > 动态数组名
    v.push_back(x);//在尾部放入元素
    v.pop_back();//删除尾部元素
    v.back();//返回尾尾元素
    v.size();//返回元素个数
    v.clear();//清空容器
    v.begin();//返回指向容器首的迭代器(首地址)
    v.end();//尾地址
    v.insert(v.begin(), x); //o(n),在容器第m个元素之前插入元素
    v.eatase(v.begin());//o(n),删除容器的第m个元素sort(v, v + n);//排序
    sort(v.began(), v.end);//排序
    

    -----------------------------

    queue<数据类型>栈名
    s.push(x);
    s.front();
    s.pop();
    s.size();
    s.empty();
    s.swap();
    

    -----------------------------

    队列
    queue<数据类型>队列名
    q.push_back(x);
    q.front();
    q.pop_back();
    q.back();
    q.size();
    q.empty();
    q.swap();
    q.pop(x);
    

    -----------------------------

    传送

    -----------------------------

    hydro主页

    点击

    -----------------------------

    好玩的

    -----------------------------

    随机打开网页

    点击

    -----------------------------

    游戏

    -----------------------------

    像素火影

    点击

    -----------------------------

    超级猫里奥

    点击

    -----------------------------

    打字小游戏

    点击

    -----------------------------

    驾驶小游戏

    点击

    -----------------------------

    国家模拟器

    点击

    -----------------------------

    塔防小游戏

    点击

    -----------------------------

    实用的

    -----------------------------

    91小键人

    点击

    -----------------------------

    翻译器

    点击

    -----------------------------

    浴谷

    点击

    -----------------------------

    STL标准库

    点击

    -----------------------------

    未完待续!!!(持续更新中)

    未完待续!!!

    -----------------------------

    我做的游戏不喜勿喷

    希望能给我点建议,谢谢(7月17日更新)

    代码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;
    //				cout << "未开放";
    //				Sleep(1000);
    //				system("Cls");
    //				jk();
    				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");
    	cout << "本游戏为任致远-4884所创作,请勿抄袭" << endl;
    	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;
    //		if (j) {
    //			break;
    //		}
    		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(){   
      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);
      //Sleep(100);
      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);
      //Sleep(100);
      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);
    }
    
  • 最近活动