int fun(int n) { int a, b, r; static int gcd = 0; if (0 == gcd) return gcd = n; a = gcd, b = n; while (r = a % b) { a = b, b = r; } return gcd = b; }