유클리드호제법
-
백준 14490번 : 백대열(C 언어)c c++ 언어 공부 2023. 9. 5. 10:10
https://www.acmicpc.net/problem/14490 14490번: 백대열 n과 m이 :을 사이에 두고 주어진다. (1 ≤ n, m ≤ 100,000,000) www.acmicpc.net Code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 #include int gcd(int a, int b) { int A=0, B=0; if (a > b) { A = a; B = b; } else { A = b; B = a; } if (B == 0) { return A; } else return gcd(B, A % B); } int main() { int n, m; scanf("%d:%d", &n,..