Advertisement
Spocoman

Bonus Score

Sep 15th, 2023
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int number;
  7.     cin >> number;
  8.  
  9.     double bonus = 0;
  10.  
  11.     if (number <= 100) {
  12.         bonus = 5;
  13.     }
  14.     else if (number > 1000){
  15.         bonus = number * 0.1;
  16.     }
  17.     else{
  18.         bonus = number * 0.2;
  19.     }
  20.  
  21.     if (number % 2 == 0) {
  22.         bonus++;
  23.     }
  24.     else if (number % 10 == 5) {
  25.         bonus += 2;
  26.     }
  27.  
  28.     cout << bonus << endl << number + bonus << endl;
  29.    
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement