005 双分支结构

 

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int tmp;
	cin>>tmp;
	if(1<=tmp&&tmp<=9)
	{
		if(tmp==1)
		{
			cout<<"one";
		} 
		else if(tmp==2)
		{
			cout<<"two";
		}
		else if(tmp==3)
		{
			cout<<"three";
		}
		else if(tmp==4)
		{
			cout<<"four";
		}
		else if(tmp==5)
		{
			cout<<"five";
		}
		else if(tmp==6)
		{
			cout<<"six";
		}
		else if(tmp==7)
		{
			cout<<"seven";
		}
		else if(tmp==8)
		{
			cout<<"eight";
		}
		else if(tmp==9)
		{
			cout<<"nine";
		}
	}
	else
	{
		cout<<"out";
	}
	return 0;
}

 

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,r=0;
	cin>>n;
	if(n<200)
	{
		r=n;
	}
	else if(200<=n||n>=299)
	{
		r=n+50;
	}
	else if(300<=n||n>=499)
	{
		r=n+100;
	}
	else if(500<=n)
	{
		r=n+200;
	}
	cout<<r;
	return 0;
}

 

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n/1000000000!=0)
	{
		cout<<"shi yi";
	}
	else if(n/100000000!=0)
	{
		cout<<"yi";
	}
	else if(n/10000000!=0)
	{
		cout<<"qian wan";
	}
	else if(n/1000000!=0)
	{
		cout<<"bai wan";
	}
	else if(n/100000!=0)
	{
		cout<<"shi wan"; 
	}
	else if(n/10000!=0)
	{
		cout<<"wan";
	}
	else if(n/1000!=0)
	{
		cout<<"qian";
	}
	else if(n/100!=0)
	{
		cout<<"bai";
	} 
	else if(n/10!=0)
	{
		cout<<"shi";
	}
	else if(n/1!=0)
	{
		cout<<"ge";
	}
	return 0;
}

 

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if(a>=b)
	{
		if(a>=c)
		{
			if(a>=d)
			{
				cout<<a;
			}
			else
			{
				cout<<d;
			}
		}
		else
		{
			if(c>=d)
			{
				cout<<c;
			} 
			else
			{
				cout<<d;
			}
		}
	}
	else
	{
		if(b>=c)
		{
			if(b>=d)
			{
				cout<<b;
			}
			else
			{
				cout<<d;
			}
		}
		else
		{
			if(c>=d)
			{
				cout<<c;
			}
			else
			{
				cout<<d; 
			}
		}
	}
	return 0;
}

 

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,sum=0;
	cin>>n;
	if(n>=90)
	{
		sum=n*3;
	}
	else if(n>=80||n<90)
	{
		sum=n*2;
	}
	else if(n>=70||n<80)
	{
		sum=n;
	}
	else if(n<70)
	{
		sum=50;
	}
	cout<<sum;
	return 0;
}

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值