Josif_tepe

Untitled

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