Advertisement
Josif_tepe

Untitled

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