#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
double speed,n,op,sum=0;
int ans;
cout<<"欢迎来到燃烧吧最强大脑第一季,有请主持人——蒋昌建!"<<endl;
cout<<"第一个项目叫闪电心算,顾名思义,是考验计算能力的项目。"<<endl;
srand(time(NULL));
int num;
cin>>num;
for(int j=1;j<=num;j++)
{
cout<<"请输入加(1)/减(2)/加减混合(3):";
cin>>op;
cout<<"请输入题目数量:";
cin>>n;
cout<<"请输入速度间隔:";
cin>>speed;
int sleep=speed*1000;
system("cls");
cout<<"闪电心算正式开始!";
Sleep(2500);
system("cls");
cout<<"3";
Sleep(1000);
system("cls");
cout<<"2";
Sleep(1000);
system("cls");
cout<<"1";
Sleep(1000);
system("cls");
for(int i=1;i<=n;i++)
{
system("cls");
int a=rand()%9+1,b=rand()%4+1;
if(b==1) cout<<"-";
else cout<<"+";
cout<<a;
if(b==1) sum-=a;
else sum+=a;
Sleep(sleep);
}
system("cls");
cout<<"请输入你的最终答案:";
cin>>ans;
if(ans==sum) cout<<"正确"<<endl;
else
{
cout<<"错误"<<endl;
cout<<"正确答案是:"<<sum<<endl;
}
system("cls");
}
return 0;
}