Advertisement
Josif_tepe

Untitled

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