游客 Signup | Login
中文 | En

2919 - 征收税金

对一批货物征收税金。价格在1万元及以上的货物征税5%,在5000元及以上、1万元以下的货物征税3%,在1000元及以上、5000元以下的货物征税2%,1000元以下的货物免税。编写一程序,读入货物价格,计算并输出税金。

Input

一行:一个实数,表示货物价格

Output

一行:一个实数,表示税金,小数保留两位。

Examples

Input

2000

Output

40.00

Solution C++

#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int a,b,c,d,e,f,g,h,i;
	scanf("%d",&a);
	while(a>=10000)
	{
		cout<<a/95*2<<".00"<<endl;
		return 0;
	}
	while(a>=5000)
	{
		cout<<a/97*2<<".00"<<endl;
		return 0;
	}
	while(a>=1000)
	{
		cout<<a/98*2<<".00"<<endl;
		return 0;
	}
	
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题