#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{double speed,n,op,sum=0;int ans;srand(time(NULL));cout<<"请输入加(1)/减(2)/加减混合(3):";cin>>op;cout<<"请输入题目数量:";cin>>n;cout<<"请输入速度间隔:";cin>>speed;int shui=speed*1000;system("cls");cout<<"闪电心算正式开始!";Sleep(5000); 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(shui); }system("cls");cout<<"请输入你的最终答案:";cin>>ans;if(ans==sum) cout<<"正确"<<endl;else {cout<<"错误"<<endl;cout<<"sum:"<<sum<<endl;}return 0;
}