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