#include <iostream>
int nwd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
int main() {
int a, b;
std::cout << "Podaj dwie liczby: ";
std::cin >> a >> b;
std::cout << "NWD(" << a << ", " << b << ") = " << nwd(a, b) << std::endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: