Advertisement
Josif_tepe

Untitled

Feb 3rd, 2024
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int k1, k2, k3, k4, k5;
  6.     cin >> k1 >> k2 >> k3 >> k4 >> k5;
  7.     int s;
  8.     cin >> s;
  9.    
  10.     int kancelarii = 0;
  11.     if(s == 1) {
  12.         kancelarii = 0;
  13.     }
  14.     else if(s == 2) {
  15.         kancelarii = k1;
  16.     }
  17.     else if(s == 3) {
  18.         kancelarii = k1 + k2;
  19.     }
  20.     else if(s == 4) {
  21.         kancelarii = k1 + k2 + k3;
  22.     }
  23.     else {
  24.         kancelarii = k1 + k2 + k3 + k4;
  25.     }
  26.    
  27.     if(kancelarii < 1) {
  28.         cout << 100 << endl;
  29.     }
  30.     else if(kancelarii >= 1 and kancelarii <= 5) {
  31.         cout << 80 << endl;
  32.     }
  33.     else if(kancelarii >= 6 and kancelarii <= 20) {
  34.         cout << 60 << endl;
  35.     }
  36.     else {
  37.         cout << 50 << endl;
  38.     }
  39.     return 0;
  40. }
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement