Advertisement
iPsych0

Rest of a Division

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