#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int a, b;
cin >> a;
cin >> b;
cout << "НОД(" << a << ";" << b << ")=";
while (a != 0 and b != 0) {
if (a > b) {
a = a % b;
}
else {
b = b % a;
cout << a + b << endl;
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int a, b;
cin >> a;
cin >> b;
cout << "НОД(" << a << ";" << b << ")=";
while (a != 0 and b != 0) {
if (a > b) {
a = a % b;
}
else {
b = b % a;
}
}
cout << a + b << endl;
}