Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b;
- cout << "Podaj dwie liczby naturalne: ";
- cin >> a >> b;
- while(a != b) // != - różnią się od siebie
- {
- if(a > b)
- a -= b;
- if(b > a)
- b -= a;
- }
- cout << "Najwiekszy wspolny dzielnik dwoch podanych liczb wynosi " << a << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement