View Code of Problem 70

#include <stdio.h>
int main()
{
	int I,y;
	scanf("%d", &I);
	if (I <= 100000)
		y = I * 0.1;
	else if (I > 100000 && I <= 200000)
		y = (I - 100000) * 0.075 + 10000;
	else if (I > 200000 && I <= 400000)
		y = (I - 200000) * 0.05 + 17500;
	else if (I > 400000 && I <= 600000)
		y = (I - 400000) * 0.03 + 27500;
	else if (I > 600000 && I <= 1000000)
		y = (I - 600000) * 0.015 + 33500;
	else
		y = (I - 1000000) * 0.01 + 39500;
	printf("%d\n", y);
	return 0;
}

Double click to view unformatted code.


Back to problem 70