View Code of Problem 70

#include<bits/stdc++.h>
using namespace std; 
int main() {
	int money, bonus;
	while(scanf("%d",&money)!=EOF){
		if (money <= 100000) bonus = 0.1 * money;
		else if (money <= 200000) bonus = 10000 + (money - 100000) * 0.075;
		else if (money <= 400000) bonus = 17500 + (money - 200000) * 0.05;
		else if (money <= 600000) bonus = 27500 + (money - 400000) * 0.03;
		else if (money <= 1000000) bonus = 33500 + (money - 600000) * 0.015;
		else if (money > 1000000) bonus = 39500 + (money - 1000000) * 0.01;
		printf("%d\n",bonus);
	}
} 

Double click to view unformatted code.


Back to problem 70