Home > Back-end >  You big help to look at, where is this one?
You big help to look at, where is this one?

Time:11-22

This is the code:
#include
Int main ()
{
Float bonus;
Float profit;
int n;
Printf (" please input current profits (unit: RMB ten thousand) : ");
The scanf (" % f ", & amp; Profit);
N=profit/10;
If (n> 10) {
N=11;
}
The switch (n) {
Case 0: bonus * 0.1=profit; Printf (" bonuses for: % f ten thousand yuan \ n ", bonus). break;
Case 1: bonus * 0.12=profit; Printf (" bonuses for: % f ten thousand yuan \ n ", bonus). break;
Case 2:
Case 3: bonus * 0.14=profit; Printf (" bonuses for: % f ten thousand yuan \ n ", bonus). break;
Case 4:
Case 5: bonus * 0.16=profit; Printf (" bonuses for: % f ten thousand yuan \ n ", bonus). break;
Case 6:
Case 7:
Case 8:
Case 9: bonus * 0.18=profit; Printf (" bonuses for: % f ten thousand yuan \ n ", bonus). break;
Case 10:
Case 11: bonus * 0.2=profit; Printf (" bonuses for: % f ten thousand yuan \ n ", bonus).
}
return 0;
}
Then, if the input 96, run the screenshot:

Well, the last more than a 1,,,
O on

CodePudding user response:

Floating point said, is an approximation,

CodePudding user response:

Printf (" bonuses for: % f ten thousand yuan \ n ", bonus).=> Printf (" bonuses number is: % 2 f ten thousand yuan \ n ", bonus).
  • Related