Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5. ofstream fout("bac.txt");
  6. int n,m,k,cmmmc,m1,n1,a,b,r,x,i;
  7.  
  8. int main()
  9. {
  10. cin>>n>>m>>k;
  11. m1=m;
  12. n1=n;
  13. while(n)
  14. {
  15. r=m%n;
  16. m=n;
  17. n=r;
  18. }
  19. cmmmc=(m1*n1)/m;
  20. a=1;
  21. for(i=1;i<=k-1;i++)
  22. a=a*10;
  23.  
  24. b=a*10;
  25. cout<<a<<endl;
  26. x=cmmmc;
  27. while(x<a)
  28. x=x+cmmmc;
  29. cout<<b<<endl;
  30. while(x<=b)
  31. {
  32. cout<<x<<' ';
  33. x=x+cmmmc;
  34.  
  35. }
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement