Created
July 21, 2016 10:35
-
-
Save oskimura/6f69385d62ff6ad7f877827622f5453d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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