Advertisement
Josif_tepe

Untitled

Mar 8th, 2021
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n;
  6.     cin >> n;
  7.     int godini = 0;
  8.     for(int i = 1; i <= n; i++) {
  9.         if(i == 1) {
  10.             godini += 15;
  11.         }
  12.         else if(i == 2) {
  13.             godini += 9;
  14.         }
  15.         else if(i >= 3 and i <= 6) {
  16.             godini += 4;
  17.         }
  18.         else {
  19.             godini += 5;
  20.         }
  21.     }
  22.     cout << godini << endl;
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement