Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int divxy(int x, int y)
- {
- if(x%y==0) return 1;
- if(y%x==0) return 1;
- return 0;
- }
- int main ()
- {
- int a,b,n,aux,i;
- cin>>a>>b>>n;
- if(a>b)
- {
- aux=a;
- a=b;
- b=aux;
- }
- for(i=a; i<=b; i++)
- if(divxy(i,n))
- if(i<=n)cout<<i<<" ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement