Advertisement
Guest User

kpk 2 digit

a guest
Apr 6th, 2012
1,377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a,b,ah,bh;
  8.     cin>>a;cin>>b;
  9.     ah = a; bh = b;
  10.     while(ah!=bh)
  11.     {
  12.         while (ah<bh)
  13.         ah+=a;
  14.         while (bh<ah)
  15.         bh+=b;
  16.     }
  17.     cout<<endl<<bh;
  18.     system("pause");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement