【补档】 2026年7月22日由Gridea迁移至Gridea Pro
其实我和我爸买球,也不是一时半会了,但是呢,好久没写加上昨天发现guihub要双重验证去修bug了,所以今天才想起来写这个(修bug的过程等下再写),我们正片开始吧!
我们与彩票的大战始于欧洲杯开幕之时。4年一度的大赛,作为老球迷的我爸肯定是要买球的!在这次欧洲杯中,我爸屡战屡败,越战越勇,最终亏了几千块钱。😅
呵呵,这咋办呢:肯定是赢回来啊!
怎么赢呢?这不是问题!
⌚️第一计——看教程法
这简单:只见我爸打开抖音,大手一挥——各类买球预测便齐上阵来。预测比分:3-1 2-1……
又是见证奇迹的一个晚上,我们彩票两人走进体育彩票店,打出了第一张单子。
第二天早上,我询问我爸彩票怎么样了。
答:中了2场,但没中奖
好吧,那只能使用第二计了
📱第二计——做表格法
B站上同样有买球的教程,不过需要自己动手操作一下。
首先,找到一些联赛数据。然后便开始分析。
这中间净是些统计学的知识,我也不是行家,便不能细细道来。总之,便是分析各类数据的结果就好了…
第二天早上,彩票只中了1场……😂
💻第三计——写代码法
那天晚上,我爸看着正在玩电脑的我,陷入沉思……
然后就这样了。他让我开发一个可以预测比赛的程序。他给了我一个不知道是什么的λ(期望值)公式,然后我就投入到开发中去……
好了,下面就是我半个月辛苦努力的成果。
下面这段代码,是经过删减版的(因为还写了一点彩蛋还有机密),不想看就可以跳过了😀
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
#include <windows.h>
#include <tchar.h>
#include <conio.h>
using namespace std;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
double e=2.718282;
double P1[6],P2[6];
double lambda1,lambda2;
double t1attack,t1defend,utdhomeavrgoal,utdhome,utdhomegoal,utdhomeavrgoaled,utdhomegoaled;
double t2attack,t2defend,utdawayavrgoal,utdawayavrgoaled,utdawaygoal,utdaway,utdawaygoaled;
double t1homeavrgoal,t1home,t1homegoal,t1homeavrgoaled,t1homegoaled;
double t2awayavrgoaled,t2away,t2awaygoaled,t2awaygoal,t2awayavrgoal;
double utd;
double t1wp,t2wp;
char fun[32627],exit1[32627];
/*此处省略一些代码*/
void menu()
{
SetConsoleTextAttribute(hConsole, 0x0E);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(25);
cout<<" § 1 预测比赛 §"<<endl;
Sleep(25);
cout<<" § 2 功能向导 §"<<endl;
Sleep(25);
cout<<" § 3 退出程序 §"<<endl;
Sleep(25);
cout<<" § 4 更新日志 §"<<endl;
Sleep(25);
cout<<" § Author:Manan §"<<endl;
Sleep(25);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(25);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(25);
cout<<" § 公告栏 §"<<endl;
Sleep(25);
cout<<" § 初来乍到,请看功能向导~ §"<<endl;
Sleep(25);
cout<<" § Man!返回键真的太难做了! §"<<endl;
Sleep(25);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(25);
cout<<"此预测结果仅代表客观来看的结果!"<<endl;
SetConsoleTextAttribute(hConsole, 0x0C);
Sleep(25);
cout<<"请勿在输入时输入字符串,不然..."<<endl;
}
void launch()
{
SetConsoleTextAttribute(hConsole, 0x09);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(25);
cout<<" By-Manan _____ ______________________"<<endl;
Sleep(25);
cout<<" / / / /"<<endl;
Sleep(25);
cout<<" / / / ------------------"<<endl;
Sleep(25);
cout<<" / / / /"<<endl;
Sleep(25);
cout<<" / / / /"<<endl;
SetConsoleTextAttribute(hConsole, 0x0D);
Sleep(25);
cout<<" / / / ------------------"<<endl;
Sleep(25);
cout<<" / / / __________________/"<<endl;
Sleep(25);
cout<<" / / / /"<<endl;
Sleep(25);
cout<<" / / / /"<<endl;
Sleep(25);
cout<<" / ___________________ / /"<<endl;
Sleep(25);
SetConsoleTextAttribute(hConsole, 0x0C);
Sleep(25);
cout<<" | /"<<endl;
Sleep(25);
cout<<" --------------------------- Predicting Football Matches"<<endl;
Sleep(25);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(25);
cout<<"Version:Release-1.20.1"<<endl;
Sleep(25);
cout<<"LF-Panel Loading...";
Sleep(25);
}
void guide()
{
SetConsoleTextAttribute(hConsole, 0x0B);
system("cls");
int guide1;
cout<<endl<<" [~~~~~~~~~~~~~~~~~~~~] "<<endl;
Sleep(25);
cout<<"~~~~~~Hello~你想知道什么?~~~~~~"<<endl;
Sleep(25);
cout<<"| 1 预测比赛 |"<<endl;
Sleep(25);
SetConsoleTextAttribute(hConsole, 0x0F);
Sleep(25);
cout<<"| 2 综合帮助 |"<<endl;
Sleep(25);
cout<<"| 3 问题解决 |"<<endl;
Sleep(25);
cout<<"--------------------------------"<<endl;
Sleep(25);
cout<<"输入你想了解的编号吧!(如想退出请输入4):";
cin>>guide1;
if (guide1==1)
{
SetConsoleTextAttribute(hConsole, 0x0B);
Sleep(1000);
cout<<endl<<"好的!现在为你讲解如何使用LFP进行比赛预测!"<<endl;
Sleep(1000);
cout<<"首先,你要确保自己有一套完整的联赛数据!并且只能有一个赛季的数据!"<<endl;
Sleep(1000);
cout<<"然后在首页输入功能1,根据所需的数据输入即可!"<<endl;
Sleep(1000);
cout<<"可能有些描述比较难懂,让我来为你讲解!"<<endl;
Sleep(1000);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"· 客队上赛季客场被进球数:客队上赛季作为客场球队的主场球队总进球数"<<endl;
Sleep(1000);
cout<<"· 主队上赛季主场被进球数:主队上赛季作为主场球队的客场球队总进球数"<<endl;
Sleep(1000);
cout<<"· 联盟上赛季主场被进球数:联盟上赛季客场总进球数"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(1000);
cout<<"我相信你已经完全掌握了!"<<endl;
system("pause");
guide();
}
else if (guide1==2)
{
SetConsoleTextAttribute(hConsole, 0x0B);
Sleep(1000);
cout<<endl<<"好的!现在为你讲解其他辅助功能!"<<endl;
Sleep(1000);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"· 输入3即可进入退出界面,输入0即撤销,1即退出"<<endl;
Sleep(1000);
cout<<"· 输入4可以查看更新日志,看一看这个小软件是怎么发展的!"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(1000);
cout<<"玩转这个小小软件吧!"<<endl;
system("pause");
guide();
}
else if (guide1==3)
{
SetConsoleTextAttribute(hConsole, 0x0B);
Sleep(1000);
cout<<endl<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"· Q:为什么概率加起来不是100%?"<<endl;
Sleep(1000);
cout<<"· A:因为进更多球的情况没有考虑(已经在v1.16修复)"<<endl;
Sleep(1000);
cout<<"· Q:如果真的不小心输入字符串或字符怎么办?"<<endl;
Sleep(1000);
cout<<"· A:建议重新打开软件"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
system("pause");
guide();
}
else
{
SetConsoleTextAttribute(hConsole, 0x0B);
cout<<endl;
}
}
/*此处省略一些代码...*/
void mainpro()
{
while (true)
{
system("cls");
menu();
SetConsoleTextAttribute(hConsole, 0x0E);
cout<<"输入功能编号:" ;
scanf("%s",fun);
if (fun[0]=='1')
{
predict();
}
else if (fun[0]=='2')
{
guide();
system("pause");
}
else if (fun[0]=='3')
{
SetConsoleTextAttribute(hConsole, 0x0C);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(50);
cout<<"确认退出?(0 撤销/1 退出) "<<endl;
Sleep(50);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
Sleep(50);
cout<<"请输入:";
scanf("%s",exit1);
if (exit1[0]=='1')
{
return;
}
if (exit1[0]=='0')
{
SetConsoleTextAttribute(hConsole, 0x0A);
cout<<"已撤销!"<<endl;
Sleep(50);
system("pause");
}
else
{
SetConsoleTextAttribute(hConsole, 0x0A);
cout<<"就算你输入错了,我还是想留住你~"<<endl;
Sleep(50);
system("pause");
}
}
else if (fun[0]=='4')
{
release();
}
else if (fun[0]=='M'&&fun[1]=='a'&&fun[2]=='n'&&fun[3]=='a'&&fun[4]=='n')
{
manan();
SetConsoleTextAttribute(hConsole, 0x0A);
system("pause");
}
else
{
SetConsoleTextAttribute(hConsole, 0x0A);
cout<<"输错啦!再输一遍吧!"<<endl;
system("pause");
}
}
}
void getKB()
{
while (true)
{
if (_getch()==27)
{
mainpro();
}
}
}
int main()
{
system("title LF-Panel Release-1.20.1");
launch();
Sleep(3000);
mainpro();
return 0;
}
因为网站的代码高亮有点bug,我也不想修,所以看得懂的人看得应该挺难受的吧~(2026.7:现已修复)
算上菜单的话,得有1w+代码了,也算不容易了!
话说,我这还没测试呢,谁有兴趣帮我测试下?😎😎