#include <stdio.h>#include<stdlib.h>/*the bonuses awarded by the Enterprise are based on the profit Commission and the rules are as follows: Profit (I) is less than or equal to 100,000 yuan, bonus can be raised 10%, profit is above 100,000 yuan, below 200,000 yuan, part of less than 100,000 yuan by 10% commission, higher than 100,000 yuan portion, Cocoa Commission 7.5% Between 200,000 and 400,000, the portion above 200,000 yuan can be 5%, 400,000 to 600,000 is higher than 400,000 yuan, can be a commission of 3%, 600,000 to 1 million, the portion above 600,000 yuan, can be a commission of 1.5%, higher than 1 million yuan, the portion of more than 1 million yuan by 1% Commission. Enter the current month profit I from the keyboard, the total bonus should be issued? */intMain () {Long intgain; intPrize1, Prize2, Prize4, Prize6, prize10, prize =0; Puts ("*************************************"); Puts ("* The program would solve *"); Puts ("* The problem of prize distribution *"); Puts ("*************************************"); Puts ("Please input the num of gain:"); scanf_s ("%ld", &gain); Prize1=100000*0.1; Prize2= Prize1 +100000*0.075; Prize4= Prize2 +200000*0.05; Prize6= Prize4 +200000*0.03; Prize10= Prize6 +400000*0.015; if(Gain <=100000) Prize= gain*0.1; Else if(Gain <=200000) Prize= Prize1 + (Gain-100000)*0.075; Else if(Gain <=400000) Prize= Prize2 + (Gain-200000)*0.05; Else if(Gain <=600000) Prize= Prize4 + (Gain-400000)*0.03; Else if(Gain <=1000000) Prize= Prize6 + (Gain-600000)*0.015; ElsePrize= Prize10 + (Gain-1000000)*0.01; printf ("The Prize is:%d\n", prize); GetChar ();
System ("pause"); return 0;}
C language _ Use if ' Else statement to solve bonus issue