Skip to content

Instantly share code, notes, and snippets.

@oskimura
Created July 21, 2016 10:35
Show Gist options
  • Save oskimura/6f69385d62ff6ad7f877827622f5453d to your computer and use it in GitHub Desktop.
Save oskimura/6f69385d62ff6ad7f877827622f5453d to your computer and use it in GitHub Desktop.
#include <stdio.h>
int ucrid(int a, int b)
{
int mod = a % b;
if (mod == 0) {
return b;
}
else {
return ucrid(b, mod);
}
}
int main()
{
int a,b;
scanf("%d %d", &a,&b);
int c = ucrid(a,b);
printf("%d\n",c);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment