做题

#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;
}

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值