Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x,y,p,cx,cy,i=1,cmmmc;
- cout<<"x=";cin>>x;
- cout<<"y=";cin>>y;
- cout<<"p=";cin>>p;
- cx=x;
- cy=y;
- do
- {
- if (cx>cy)
- cx-=cy;
- else
- cy-=cx;
- } while (cx!=cy);
- cmmmc=(x*y)/cx;
- do
- {
- cout<<cmmmc*i<<" ";
- i++;
- } while (i<=p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement