彩票参数游戏
2025-07-27 20:15:47
发布于:浙江
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
void color(const int &a){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);
}
int main(){
//第二次输入是张数,一张50元
//当张数大于50那么只会显示中奖次数
srand(time(0));
int wwb,money=1000,can=0;
color(14);
cout<<"设置中奖概率(1~10,数值越大概率越小)\n";
std::cin>>can;
color(15);
while(1){
int num=0;
if(money<=0) {
system("cls");
color(112);
std::cout<<"失败";
return 0;
}
std::cout<<"本金"<<money<<"\n";
std::cin>>wwb;
color(12);
std::cout<<"-"<<wwb*50<<"\n";
Sleep(1000);
money-=wwb*50;
for(int i=1;i<=wwb;i++){
int t=rand()%i+can*2;
if(i==t){
color(175);
std::cout<<"中! |<<|\n";
num++;
}else{
color(8);
if(wwb<=50){
std::cout<<"... |<<|";
std::cout<<"\n";
}
}
}
Sleep(1500);
color(15);
std::cout<<"___________\n中奖金额:\n";
Sleep(500);
int sum=0;
if(num==0){
std::cout<<"无...\n";
}
while(num--){
int t=rand()%5000000;
sum+=t;
if(t<=100000){
color(4);
std::cout<<t<<"\n";
}else if(t<=5000000){
color(14);
std::cout<<t<<"\n";
}
}
color(14);
Sleep(1000);
system("cls");
money+=sum;
color(15);
}
return 0;
}
全部评论 4
你们最多时有多少钱
1小时前 来自 浙江
0你们最多时有多少钱
1小时前 来自 浙江
0好玩 爱玩 多玩
10小时前 来自 浙江
0@坚果不会c++
怎么玩
6天前 来自 北京
0先输入购买张数,后续更新会更新玩法的,另外,要在DEVc++上运行
6天前 来自 浙江
06天前 来自 北京
0已更新
6天前 来自 浙江
0
有帮助,赞一个