View Code of Problem 70

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

Double click to view unformatted code.


Back to problem 70