View Code of Problem 70

#include<stdio.h>
int main()
{
	int x;
	int y,n=0;
	scanf("%d",&x);
	y=x/100000;
	switch(y)
	{
		case 0: 
			  n=x*0.1;
		      break;
		case 1:
		      n=1000+(x-100000)*0.075;
		      break;
		case 2: 
		      n=1750+(100000*y-200000)*0.05;
			  break;
		case 4:
		      n=2750+(100000*y-400000)*0.03;
		      break;
		case 6:
		      n=3350+(100000*y-600000)*0.015;
			  break;
		case 10:
		      n=3750+(100000*y-1000000)*0.0001;
			  break;  	        
	}
	printf("%d",n);
	
}

Double click to view unformatted code.


Back to problem 70