分支-10. 计算个人所得税

 1 /*
 2  * Main.c
 3  * B10-分支-10. 计算个人所得税(10)
 4  *  Created on: 2014年5月29日
 5  *      Author: Boomkeeper
 6  *
 7  *    测试通过
 8  */
 9 
10 
11 #include <stdio.h>
12 #include <stdlib.h>
13 
14 int main()
15 {
16     float salary=0;
17     float *ps=&salary;
18 
19     scanf("%f",ps);
20 
21     if(*ps<0)
22         exit(0);
23 
24     if(*ps<=1600 && *ps>=0)
25         printf("0.00\n");
26 
27     if(*ps<=2500 && *ps>1600)
28         printf("%.2f\n",0.05*(*ps-1600));
29 
30     if(*ps<=3500 && *ps>2500)
31         printf("%.2f\n",0.1*(*ps-1600));
32 
33     if(*ps<=4500 && *ps>3500)
34         printf("%.2f\n",0.15*(*ps-1600));
35 
36     if(*ps>4500)
37         printf("%.2f\n",0.2*(*ps-1600));
38 
39     return 0;
40 }

 

posted @ 2014-06-16 20:12  Boomkeeper  Views(396)  Comments(0Edit  收藏  举报
最好的流量统计 网站流量计数器