Advertisement
Josif_tepe

Untitled

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