1/* 2 * C language implementation 3 * B11-branch-11. calculated salary (15) 4 * Created on: June 3, 2014 5 * Author: Boomkeeper 6 * not all passed 7*8 */9 10 # include <stdio. h> 11 # include <stdlib. h> 12 13 float salary = 0; 14 15 void newStaff (int * worktime) 16 {17 if (* worktime <= 40) 18 {19 salary = (* worktime) * 30; 20 printf ("%. 2f \ n ", salary); 21} 22 else23 {24 salary = (* worktime-40) * 30*1.5 + 40*30; 25 printf (" %. 2f \ n ", salary); 26} 27} 28 29 void oldStaff (int * worktime) 30 {31 if (* worktime <= 40) 32 {33 salary = (* worktime) * 50; 34 printf ("%. 2f \ n ", salary); 35} 36 else37 {38 salary = (* worktime-40) * 30*1.5 + 40*50; 39 printf (" %. 2f \ n ", salary); 40} 41} 42 43 int main () 44 {45 int workTime = 0, workYear = 0; 46 int * worktime = & workTime, * workyear = & workYear; 47 48 scanf ("% I", workyear, worktime); 49 50 if (* worktime <0 | * workyear <0) // data smaller than 0 is abnormal 51 exit (0); 52 if (* worktime> (7*24 )) // abnormal 53 exit (0), 54 55 if (* workyear <5) 56 newStaff (worktime), and 57 else58 oldStaff (worktime) when the number of hours in a week exceeds 7*24 ); 59 60 return 0; 61}