Simple IF ELSE

Write a program that calculates the salary increase.

Requirements: If the basic salary is greater than or equal to 5,000 yuan, increase the salary by 10%; if it is greater than or equal to 2,500 yuan and less than 5,000 yuan, increase by 15%; if it is less than 2,500 yuan, increase the salary by 15%.

20% salary increase.

#include<iostream>
using namespace std;
intmain()
{
	int n1,n2,n3,temp;
	cin>>n1>>n2>>n3;
	if(n1>n2)
	{
		temp=n1;
		n1=n2;
		n2=temp;
	}
	if(n2>n3)
	{
		temp=n2;
		n2=n3;
		n3=temp;
	}
	if(n1>n3)
	{
		temp=n1;
		n1=n3;
		n3=temp;
	}
	cout<<n1<<" "<<n2<<" "<<n3<<endl;
	return 0;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325731814&siteId=291194637