Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ofstream fout("bac.txt");
- int n,m,k,cmmmc,m1,n1,a,b,r,x,i;
- int main()
- {
- cin>>n>>m>>k;
- m1=m;
- n1=n;
- while(n)
- {
- r=m%n;
- m=n;
- n=r;
- }
- cmmmc=(m1*n1)/m;
- a=1;
- for(i=1;i<=k-1;i++)
- a=a*10;
- b=a*10;
- cout<<a<<endl;
- x=cmmmc;
- while(x<a)
- x=x+cmmmc;
- cout<<b<<endl;
- while(x<=b)
- {
- cout<<x<<' ';
- x=x+cmmmc;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement