跳到正文

个人记录

营销号的同款游戏

XiaTianYi约 3 分钟
原文
文章信息与版本

文章信息

发布
2026年2月27日
收录
2026年2月27日
更新
2026年11月14日
篇幅
约 3 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int zd=5,nums,plhp=50;
struct number{
	int x,y;
}t;
number numrand(){
	int a_n=max(0,rand()%10-rand()%3+rand()%3);
	if(rand()%2==0) a_n=-a_n;
	int b_n=max(0,rand()%10-rand()%3+rand()%3);
	if(rand()%2==0) b_n=-b_n;
	return{a_n,b_n};
}
int main(){
	srand(time(0));
	cout<<"咕噜咕噜~\n";
	Sleep(500);
	for(int i=1;i<=15;i++){
		cout<<"子弹:"<<zd<<endl;
		t=numrand();
		cout<<(t.x>=0?"|+":"|")<<t.x<<(t.y>=0?"|+":"|")<<t.y<<'|'<<endl;
		cin>>nums;
		if(nums<=0||nums>=3){
			cout<<"    你掉了下去。";
			Sleep(1000);
			system("cls");
			cout<<"  《   失 败 !  》";
			return 0;
		}
		if(nums==1){
			cout<<"你选择了"<<(t.x>=0?"+":" ")<<t.x;
			zd+=t.x;
		}
		if(nums==2){
			cout<<"你选择了"<<(t.y>=0?"+":" ")<<t.y;
			zd+=t.y;
		}
		Sleep(1500);
		system("cls");
	}
	cout<<"  子弹:"<<zd<<endl;
	cout<<"   <BOSS>营销号\n";
	int bj=rand()%5;
	int hp=91;
	Sleep(1000);
	for(;1<=zd&&plhp>=1&&hp>=1;zd--){
		cout<<"造成"<<(bool)(zd<=25)+2<<"伤害\n";
		if(rand()%5+zd%2==bj){
			cout<<"暴击!额外造成"<<zd<<"伤害\n";
			hp-=zd;
			plhp+=5;
			Sleep(500);
		}
		cout<<"BOSS对你造成了10点伤害\n";
		plhp-=10;
		Sleep(2000);
		system("cls");
	}
	if(hp<=0){
		cout<<"你竟然通关了,扣工资!你没钱了,你穷死了!";
		return 0;
	}
	else if(zd<=0){
		cout<<"你没子弹了,被打死了\n  失败!";
		return 0;
	}
	else if(plhp<=0){
		cout<<"这关无解!别笑,你来你也过不去!";
		return 0;
	}
	return 0;
}
原文