Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int nww(int a, int b)
  6. {
  7. int i = a * b;
  8. while(a!=b)
  9. {
  10. (a > b)? a-=b : b-=a;
  11. }
  12.  
  13. return(i/a);
  14. }
  15.  
  16. int main(void)
  17. {
  18.  
  19. int a,b;
  20. cin >> a;
  21. cin >> b;
  22. cout << nww(a,b);
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement