#include <iostream>
using namespace std;
int nod ( int , int );
int main ( void )
{
setlocale(LC_ALL,"rus");
int a,b;
cout << "A = ";
cin >> a;
cout << "B = ";
cin >> b;
if ( b == 0 ) {
cout << a << endl;
}
else {
cout << nod(a,b) << endl;
}
system( "pause");
}
int nod ( int a, int b )
{
while ( a != b )
{
if ( a > b )
a -= b;
else
b -= a;
}
return a;
}
#include <iostream>
using namespace std;
int nod ( int , int );
int main ( void )
{
setlocale(LC_ALL,"rus");
int a,b;
cout << "A = ";
cin >> a;
cout << "B = ";
cin >> b;
if ( b == 0 ) {
cout << a << endl;
}
else {
cout << nod(a,b) << endl;
}
system( "pause");
}
int nod ( int a, int b )
{
while ( a != b )
{
if ( a > b )
a -= b;
else
b -= a;
}
return a;
}
конечно спасибо. но все таки что то не выходит. можешь свой скайп ать?