2014-12-30 GCD 最大公約数を求める c++ int gcd(int a, int b) {return a == 0 ? b : gcd(b%a,a);} ちなみにGreatest Common Divisorの略。