#include<bits/stdc++.h>//fixed<<setprecision(2)
using namespace std;//for(int i=1;i<=a;i++)
int main()
{
long double a,b,d,f,g,h,i=1,j=0,s,l=0,x;
char c,e;
cout<<"本软件有这些功能:"<<endl<<"[1] 带儿童锁(密码)"<<endl<<"[2] 可规定次数"<<endl<<"[3] 加减乘除样样精通"<<endl<<"[4] 自带评论"<<endl<<"3星: 4次以下 2星: 9次以下 一星: 8次以上 "<<endl<<"按“0”表示知道了"<<endl;
cin>>x;
if(x==0)
for(int i=1;i<=500;i++)
cout<<endl;
cout<<"请输入密码:";
cin>>a;
if(a==1478278)
{
cout<<"请输入限制次数:";
cin>>s;
for(int i=1;i<=s;i++)
{
j=0;
cout<<"请输入算式:" ;
cin>>b>>c>>d>>e;
if(c=='+')
g=b+d;
if(c=='-')
g=b-d;
if(c=='*')
g=b*d;
if(c=='/')
g=b/d;
cin>>h;
if(h!=g)
j++;
while(h!=g)
{
cout<<"错误"<<endl;
j++;
l++;
cin>>h;
if(j==3)
{
if(!(i<=s))
{
cout<<"您同一题已错误三次,请再次输入算式:";
}
break;
}
}
if(j!=3)
cout<<"正确"<<endl;
j--;
if(h!=g)
{
j++;
l++;
}
}
cout<<"您错误了"<<l<<"次"<<endl;
if(l<4)
cout<<"三星";
else
if(l<9)
cout<<"二星";
else
cout<<"一星";
}
else
cout<<"密码错误"<<endl;
return 0;
}
做题
最新推荐文章于 2022-08-17 20:38:08 发布