1. 程式人生 > >經典收藏(發工資)

經典收藏(發工資)

#include <stdio.h> 發工資 int main() { const double RATE = 8.25; const int STANDARD = 40; double pay = 0.0; int hours;

printf(“請輸入工作的小時數: “); scanf(”%d”, &hours); printf("\n"); if (hours > STANDARD) pay = STANDARD * RATE + (hours-STANDARD) * (RATE * 1.5); else pay = hours * RATE; printf(“應付工資: %f\n”, pay);

return 0; }