Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- int a, b;
- int main()
- {
- cout << "Podaj liczbe A:" << endl;
- cin >> a;
- cout << "Podaj liczbe B:" << endl;
- cin >> b;
- while (a != b)
- {
- if (a > b)
- {
- a -= b;
- }
- else
- {
- b -= a;
- }
- }
- cout << "NWD tych liczb wynosi: " << a << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement