Advertisement
Josif_tepe

Untitled

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