Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int nww(int a, int b)
- {
- int i = a * b;
- while(a!=b)
- {
- (a > b)? a-=b : b-=a;
- }
- return(i/a);
- }
- int main(void)
- {
- int a,b;
- cin >> a;
- cin >> b;
- cout << nww(a,b);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement