#include<iostream>
#include<cstdlib>
using namespace std;
//Operator warunkowy ?
//(warunek ? true : false)
int nwd(int a, int b)
{
if(a!=b)
return nwd(if (a>b) a=a-b; else b = b-a;);
return a;
}
int main()
{
int a, b;
cout<<"Podaj dwie liczby: ";
cin>>a>>b;
cout<<"NWD("<<a<<","<<b<<") = "<<nwd(a,b)<<endl;
return 0;
}