View Code of Problem 70

#include<stdio.h>

int main()
{
	long long num;
	long long price;
	while(scanf("%lld", &num) != EOF)
	{
		if(num <= 100000)
			price = 0.1*num;
		else if(num <= 200000)
			price = 10000+(num-100000)*0.075;
		else if(num <= 400000)
			price = 17500+(num-200000)*0.05;
		else if(num <= 600000)
			price = 27500+(num-400000)*0.03;
		else if(num <= 1000000)
			price = 33500+(num-600000)*0.015;
		else
			price = 39500+(num-1000000)*0.01;
		printf("%lld\n", price);
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 70