From 387d4b12272bd8c7fe8ebcd1885abd8560f905b2 Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Thu, 26 Jun 2025 21:35:19 +0900 Subject: [PATCH] 20250626 baekjoon --- code_study/Baekjoon/c/2609.c | 24 ++++++++++++++++++++++++ code_study/Baekjoon/js/2609.js | 7 +++++++ code_study/Baekjoon/python/2609.py | 5 +++++ 3 files changed, 36 insertions(+) create mode 100644 code_study/Baekjoon/c/2609.c create mode 100644 code_study/Baekjoon/js/2609.js create mode 100644 code_study/Baekjoon/python/2609.py diff --git a/code_study/Baekjoon/c/2609.c b/code_study/Baekjoon/c/2609.c new file mode 100644 index 0000000..6dd8c34 --- /dev/null +++ b/code_study/Baekjoon/c/2609.c @@ -0,0 +1,24 @@ +#include + +int main() { + int a, b; + scanf("%d %d",&a, &b); + if(a y!==0 ? GCD(y, x%y) : x; +const gcd = GCD(a,b); +const lcm = a*b/gcd; +console.log(gcd); +console.log(lcm); \ No newline at end of file diff --git a/code_study/Baekjoon/python/2609.py b/code_study/Baekjoon/python/2609.py new file mode 100644 index 0000000..1013358 --- /dev/null +++ b/code_study/Baekjoon/python/2609.py @@ -0,0 +1,5 @@ +a, b = map(int, input().split()) +x, y = max(a,b), min(a,b) +while y : + x, y = y, x%y +print(f"{x}\n{a*b//x}") \ No newline at end of file