#include <iostream>
enum Lirun
{
one = 100000,
two = 200000,
three = 400000,
four = 600000,
five = 1000000
};
int main()
{
int i,sum;
Lirun l;
while (std::cin >> i)
{
if (i <= one)
sum = 0.1 * i;
if (i > one && i <= two)
sum = 0.1 * one + 0.075 * (i - one);
if (i > two && i <= three)
sum = 0.1 * one + 0.075 * (two - one) + 0.05 * (i - two);
if (i > three && i <= four)
sum = 0.1 * one + 0.075 * (two - one) + 0.05 * (three - two) + 0.03 * (i - three);
if (i > four && i <= five)
sum = 0.1 * one + 0.075 * (two - one) + 0.05 * (three - two) + 0.03 * (four - three)+0.015*(i-four);
if(i>five)
sum = 0.1 * one + 0.075 * (two - one) + 0.05 * (three - two) + 0.03 * (four - three) + 0.015 * (five - four)+0.01*(i-five);
std::cout << sum << std::endl;
}
}
因为今天刚学习了枚举,所以就趁热使用一下,其余的也都很基础。