すでに知っている税の後で税の前の給料を求めます
6195 ワード
\*
3500 。
=( -3500)* -
1 1,500 3% 0
2 1,500 4,500 10% 105
3 4,500 9,000 20% 555
4 9,000 35,000 25% 1005
5 35,000 55,000 30% 2,755
6 55,000 80,000 35% 5,505
7 80,000 45% 13,505
*\
#include
#include
int main(){
int t;
printf(" 3500
");
printf(" :");
while(1){
scanf("%d",&t);
if (t < 0){
printf(" , :
");
}
else{
break;
}
}
/*
1500
4500 -1500
9000 -4500
35000 - 9000
*/
int n = t - 3500;
int a1 = 1500 * 0.97;
int a2 = a1 + 3000 * 0.9;
int a3 = a2 + 4500 * 0.8;
int a4 = a3 + 26000 * 0.75;
int a5 = a4 + 20000 * 0.7;
int a6 = a5 + 25000 * 0.65;
int s = 0;
if( n < 0 ){
s = t;
}
/*
3500
3500 + 1500
3500 + 4500
3500 + 9000
*/
else if(n <= a1 && n > 0){
s = (int)(3500+n/0.97);
}
else if(n > a1 && n <= a2){
s = (int)(5000 +(n-a1)/0.9);
}
else if(n > a2 && n <= a3){
s = (int)(8000 +(n-a2)/0.8);
}
else if(n > a3 && n <= a4){
s = (int)(12500+(n-a3)/0.75);
}
else if(n > a4 && n <= a5){
s = (int)(38500+(n-a4)/0.7);
}
else if(n > a5 && n <= a6){
s = (int)(3500+(n-a5)/0.65);
}
else if(n > a6){
s = (int)(3500+(n-a6)/0.55);
}
printf(" :%d
",s);
getchar();
return 0;
}