每场比赛的胜平负赔率都是相异的,我们考虑借用3个账户,分别对胜平负三种情况进行投注,借用赔率之间的差异,通过计算看能否找到一种方案使得收益永远大于等于支出,即所谓达到的“稳赚不亏”。
赔率参考表:
瑞典VS韩国?
/*代码:世界杯投注稳赚不亏策略?*/
/* 例:瑞典 VS 韩国*/ /*赔率:1.77:4.20:3.06 */
#include<bits/stdc++.h>
using namespace std;
#define Maxn 1000
int main()
{
double Switzerland,Korean,Draw; //投注金额:瑞士,韩国,平局
double Swin=1.77,Kwin=4.20,Dwin=3.06; //赔率
for(Switzerland=0; Switzerland<Maxn; Switzerland++)
{
for(Korean=0; Korean<Maxn; Korean++)
{
for(Draw=0; Draw<Maxn; Draw++)
{
if(Swin*Switzerland>=Switzerland+Korean+Draw&& //瑞士赢:收益>=本金
Dwin*Draw>=Switzerland+Korean+Draw&& //平局· :收益>=本金
Kwin*Korean>=Switzerland+Korean+Draw) //韩国赢:收益>=本金
cout<<Switzerland<<' '<<Draw<<' '<<Korean<<endl;
}
}
}
return 0;
}
多组输入:
#include<bits/stdc++.h>
using namespace std;
#define Maxn 1000
int main()
{
double CountryA,CountryB,Draw; //投注金额:CountryA,CountryB,平局
double Awin,Bwin,Dwin; //赔率
while(true)
{
cout<<"请输入赔率:CountryA CountryB Draw "<<endl;
cin>>Awin>>Bwin>>Dwin;
for(CountryA=0; CountryA<Maxn; CountryA++){
for(CountryB=0; CountryB<Maxn; CountryB++){
for(Draw=0; Draw<Maxn; Draw++){
if(Awin*CountryA>=CountryA+CountryB+Draw&&
Dwin*Draw>=CountryA+CountryB+Draw&&
Bwin*CountryB>=CountryA+CountryB+Draw)
{cout<<"稳赚不赔投资分配:"<<endl;
cout<<"CountryA :"<<CountryA<<endl;
cout<<"CountryB :"<<CountryB<<endl;
cout<<"Draw :"<<Draw<<endl;}
}
}
}
cout<<endl;
}
return 0;
}
带有最大赔率:
#include<bits/stdc++.h>
using namespace std;
#define Maxn 1000
int main()
{
double CountryA,CountryB,Draw; //投注金额:CountryA,CountryB,平局
double Awin,Bwin,Dwin; //赔率
while(true)
{
double maxrate;
cout<<"请输入赔率:CountryA CountryB Draw "<<endl;
cin>>Awin>>Bwin>>Dwin;
cout<<"请输入最大亏损承受率:(0~1)"<<endl;
cin>>maxrate;
for(CountryA=0; CountryA<Maxn; CountryA++){
for(CountryB=0; CountryB<Maxn; CountryB++){
for(Draw=0; Draw<Maxn; Draw++){
double minloss=(CountryA+CountryB+Draw)*(1-maxrate); //亏损范围在本金
if(Awin*CountryA>=minloss&&
Dwin*Draw>=minloss&&
Bwin*CountryB>=minloss)
{cout<<"稳赚不赔投资分配:"<<endl;
cout<<"CountryA :"<<CountryA<<endl;
cout<<"CountryB :"<<CountryB<<endl;
cout<<"Draw :"<<Draw<<endl;}
}
}
}
cout<<endl;
}
return 0;
}