Josif_tepe

Untitled

Feb 12th, 2026
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int k;
  9.     cin >> k;
  10.     int t1;
  11.     cin >> t1;
  12.     int t2;
  13.     cin >> t2;
  14.     int t3;
  15.     cin >> t3;
  16.     int t4;
  17.     cin >> t4;
  18.     int t5;
  19.     int zbir = t1 + t2 +t3 +t4;
  20.     for(int i=0; i <= 100; i++) {
  21.         int vkupno = zbir + i;
  22.         vkupno /= 5;
  23.         if(k == 2 and vkupno >= 60) {
  24.             cout << i <<endl;
  25.             return 0;
  26.         }
  27.         else if(k == 3 and vkupno >=70){
  28.             cout << i <<endl;
  29.             return 0;
  30.         }
  31.         else if(k== 4 and vkupno >= 80){
  32.             cout<< i <<endl;
  33.             return 0;
  34.         }
  35.         else if(k == 5 and vkupno >= 90){
  36.             cout << i<<endl;
  37.             return 0;
  38.         }
  39.  
  40.  
  41.     }
  42. cout << "GRESHKA" <<endl;
  43.  
  44.     return 0;
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment