代码上,我(是菜鸡)
#include<bits/stdc++.h>
using namespace std;
int main()
{
int cin_1;
long long cin_a,a,b;
short sum=0,sum2;
const long long canshu_a=158467205891;
cout<<"欢迎使用计算训练!!!\n";
for(;;)
{
cout<<"请选择:1. 1-100加法 2. 1-100减法 3. 1-100乘法(可使用计算器) 4. 1-100除法(例:5/3填1,无需小数,无需余数;被除数小于除数则为0) 5. 产品信息 6. 退出\n";
cin>>cin_1;
for(short n=10,i=1;i<=n;i++)
{
srand(time(0));
a=rand()%100+1;
b=rand()%100+1;
if(cin_1==1)
{
cout<<"\n\n\n\n\n\n\n\n\n\n"<<a<<'+'<<b<<"=";
cin>>cin_a;
sum2=a+b;
if(cin_a==sum2)
{
cout<<"tick\n";
sum+=10;
}
else
{
cout<<"cross\n";
}
}
else if(cin_1==2)
{
cout<<"\n\n\n\n\n\n\n\n\n\n"<<a<<'-'<<b<<"=";
cin>>cin_a;
sum2=a-b;
if(cin_a==sum2)
{
cout<<"tick\n";
sum+=10;
}
else
{
cout<<"cross\n";
}
}
else if(cin_1==3)
{
cout<<"\n\n\n\n\n\n\n\n\n\n"<<a<<'*'<<b<<"=";
cin>>cin_a;
sum2=a*b;
if(cin_a==sum2)
{
cout<<"tick\n";
sum+=10;
}
else
{
cout<<"cross\n";
}
}
else if(cin_1==4)
{
cout<<"\n\n\n\n\n\n\n\n\n\n"<<a<<'/'<<b<<"=";
cin>>cin_a;
sum2=a/b;
if(cin_a==sum2)
{
cout<<"tick\n";
sum+=10;
}
else
{
cout<<"cross\n";
}
}
}
if(cin_1==5)
{
cout<<"\n\n\n\n\n\n\n\n\n\n版本:v1.0.0\n制作:王雨泽\n出版调试次数:3\n完成时间:20230706\n用时:2天(4小时31分钟)\n备注:本人11岁,初学,勿喷!!!\n\n\n\n\n\n\n\n\n\n";
}
else if(cin_1!=6&&cin_1!=5)
{
cout<<"\n\n\n\n\n\n\n\n\n\n获得"<<sum<<"分\n\n\n\n\n\n\n\n\n\n\n";
}
else if(cin_1==5)
{
}
else if(cin_1==6)
{
break;
}
else
{
for(;;)
{
cout<<"[Error]cin_1 ! <=1&&>=6\n";
}
}
}
return 0;
}