Programul scade din cel mai mare pe cel mai mic, indiferent de ordinea lor.
#include <iostream>
using namespace std;
int x,y,r,c;
int main()
{
cin>>x>>y;
if (x>y)
{
while (x>y)
{
c++;
x=x-y;
}
r=x;
}
else
{
while (y>x)
{
c++;
y=y-x;
}
r=y;
}
cout<<c<<" "<<r;
}