Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- unsigned nwd(unsigned a, unsigned b)
- {
- while(a != b)
- if(a > b)
- a -= b;
- else
- b -= a;
- return a;
- }
- unsigned nww(unsigned a, unsigned b)
- {
- }
- int main()
- {
- cout << "Podaj dwie liczby naturalne: ";
- unsigned a, b;
- cin >> a >> b;
- cout << "Najwiekszy wspolny dzielnik liczb " << a << " i " << b << " wynosi " << nwd(a, b);
- cout << ", a najmniejsza wspolna wielokrotnosc wynosi " << nww(a, b) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement