Created
June 1, 2018 12:51
-
-
Save tmk815/9cd34b1154d8ae69ef235b4a943d03f3 to your computer and use it in GitHub Desktop.
ユークリッドの互除法
This file contains 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 gcd(int,int); | |
int main(void) { | |
int a, b; | |
a=394; | |
b=985; | |
printf("%d\n",gcd(a,b)); | |
} | |
int gcd(int a,int b){ | |
return b==0 ? a : gcd(b,a%b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment