#include <iostream>
using namespace std;
int NOD(int a, int b) {
int iter = 0;
if (a < b) {
swap(a, b);
}
while (a % b != 0) {
a = a % b;
iter++;
cout<<"NOD: "<< b << " Iteration: "<< iter;
int main()
{
int a,b;
cin>>a>>b;
NOD(a,b);
return 0;
#include <iostream>
using namespace std;
int NOD(int a, int b) {
int iter = 0;
if (a < b) {
swap(a, b);
}
while (a % b != 0) {
a = a % b;
swap(a, b);
iter++;
}
cout<<"NOD: "<< b << " Iteration: "<< iter;
}
int main()
{
int a,b;
cin>>a>>b;
NOD(a,b);
return 0;
}