世界杯投注稳赚不亏策略（代码）

/*代码：世界杯投注稳赚不亏策略？*/
/*  例：瑞典 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;
}