View Code of Problem 70

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <iomanip>
#include<vector>
#include<math.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	if (n <= 100000) {
		cout << n * 0.1;
	}
	if (100000 < n&&n <= 200000) {
		cout << 10000 + (n - 100000)*0.075;
	}
	if (200000 < n&&n <= 400000) {
		cout << 17500 + (n - 200000)*0.05;
	}
	if (400000 < n&&n <= 600000) {
		cout << 17500 + 200000 * 0.05 + (n - 600000)*0.03;
	}
	if (600000 < n&&n <= 1000000) {
		cout << 17500 + 200000 * 0.08 + (n - 600000)*0.015;
	}
	if (n > 1000000) {
		cout << 17500 + 200000 * 0.11+(n- 1000000)*0.01;
	}
}

Double click to view unformatted code.


Back to problem 70