第一代:
C#include<bits/stdc++.h>
using namespace std;
int l,r;
inline int rnd(int l,int r)
{
return rand()%(r-l+1)+l;
}
int main()
{
srand(time(0));
int k=1;
int rd;
while(1)
{
k++;
if(k <= 75)
{
rd = 6;
}
else if(k == 80)
{
rd = 1000;
}
else
{
rd = (k - 75)*200;
}
int a = rnd(1,1000);
if(a <= rd)
{
int b = rnd(1,2);
cout<<"出金了"<<endl;
if(b == 2)
{
cout<<"but 歪了"<<endl;
}
cout<<"花了"<<k<<"抽";
return 0;
}
}
return 0;
}
第二代
C#include<bits/stdc++.h>
using namespace std;
int l,r;
inline int rnd(int l,int r)
{
return rand()%(r-l+1)+l;
}
int main()
{
srand(time(0));
int k=1;
int c = 0;
int rd;
int my;
int jue_x = 0;
int jue_c = 0;
cin>>my;
while(my > 0)
{
k++;
my--;
if(k <= 75)
{
rd = 6;
}
else if(k == 80)
{
rd = 1000;
}
else
{
rd = (k - 75)*200;
}
int a = rnd(1,1000);
if(a <= rd)
{
int b = rnd(1,2);
if(b == 2 && c == 0)
{
jue_c ++;
c = 1;
}
else
{
jue_x ++;
}
k = 0;
}
}
cout<<"你获得了:"<<endl;
cout<<jue_x<<"个限定金"<<endl;
cout<<jue_c<<"个常驻金"<<endl;
return 0;
}
第三代
C#include<bits/stdc++.h>
#include<Windows.h>
using namespace std;
#define scta(a) SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE),a);
string changzhu[8]={"0","迪卢克","七七","刻晴","提那里","迪西娅","琴","莫娜"};
string wuqi3[5]={"0","剑","弓","大剑","法器"};
string wuqi4[15]={"0","流浪乐章","钟剑","祭礼剑","西风剑","祭礼残章","班尼特","行秋","迪奥娜","香菱","夏洛蒂","米卡","琳妮特","九崎忍","绝弦"};
int l,r;
int k=0,k2=0;
int c = 0;
int rd;
int my;
int jue_x = 0;
int jue_c = 0;
int wuqi_z = 0;
string jue;
inline int rnd(int l,int r)
{
return rand()%(r-l+1)+l;
}
void chou()
{
k++;
k2++;
my--;
if(k <= 75)
{
rd = 6;
}
else if(k == 80)
{
rd = 1000;
}
else
{
rd = (k - 75)*200;
}
int a = rnd(1,1000);
if(a <= rd)
{
int b = rnd(1,2);
if(b == 2 && c == 0)
{
jue_c ++;
c = 1;
int d = rnd(1,7);
scta(6);
cout<<"*"<<changzhu[d]<<endl;
scta(07);
}
else
{
jue_x ++;
scta(6);
cout<<"*"<<jue<<endl;
c = 0;
scta(07);
}
k = 0;
}
else
{
if(k2 == 10)
{
int e = rnd(1,14);
scta(5);
cout<<""<<wuqi4[e]<<endl;
wuqi_z++;
scta(07);
k2 = 0;
}
else if(rnd(1,10) == 1)
{
int e = rnd(1,14);
scta(5);
cout<<""<<wuqi4[e]<<endl;
wuqi_z++;
scta(07);
k2 = 0;
}
else
{
int e = rnd(1,4);
scta(011);
cout<<""<<wuqi3[e]<<endl;
scta(07);
}
}
}
int main()
{
srand(time(0));
cin>>my;
int sum = my;
cout<<"你要抽谁的池子?"<<endl;
cin>>jue;
while(my > 0)
{
int x;
cout<<"当前抽数还剩:"<<my<<endl;
cout<<"1,单抽 2,10连"<<endl;
cin>>x;
system("cls");
if(x == 1)
{
chou();
}
if(x == 2)
{
if(my < 10)
{
cout<<"抽数不足"<<endl;
}
else
{
for(int i=1;i<=10;i++)
{
chou();
}
}
}
cout<<"_____________________"<<endl;
}
while(my > 0)
{
k++;
my--;
if(k <= 75)
{
rd = 6;
}
else if(k == 80)
{
rd = 1000;
}
else
{
rd = (k - 75)*200;
}
int a = rnd(1,1000);
if(a <= rd)
{
int b = rnd(1,2);
if(b == 2 && c == 0)
{
jue_c ++;
c = 1;
}
else
{
jue_x ++;
c = 0;
}
k = 0;
}
}
cout<<"你获得了:"<<endl;
cout<<jue_x<<"个限定金"<<endl;
cout<<jue_c<<"个常驻金"<<endl;
cout<<"平均"<<sum/(jue_x+jue_c)<<"一个金"<<endl;
cout<<"不歪的概率:"<<(jue_x-jue_c)*1.00/(jue_x)*100.00<<"%"<<endl;
// cout<<wuqi_z<<"个4星"<<endl;
Sleep(10000);
return 0;
}