07-01 02:16
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Java
- Mac
- 셀레니움
- python
- selenium
- 백준
- dbms
- Entity Set
- Polymolphism
- Binary Search
- X.org
- Operator
- systemd
- 리눅스 마스터 1급
- External Scheme
- literal
- descriptive statistics
- Inheritance
- Entity
- Unity
- Reference Type
- BFS
- OOP
- 리눅스
- 자바
- Physical Scheme
- 리눅스 기초
- preprocessing
- X윈도우
- Class
Archives
- Today
- Total
Byeol Lo
N13241 - 최소공배수 구하기 본문
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
solution(sc.nextLong(), sc.nextLong());
}
public static void solution(long a, long b) {
long lcm = lcm (a, b);
System.out.println(a * b / lcm);
}
public static long lcm (long a, long b) {
while (b != 0) {
long temp = b;
b = a % b;
a = temp;
}
return a;
}
}
'Algorithm > Math' 카테고리의 다른 글
N11653 - 소인수분해 (0) | 2024.06.22 |
---|---|
N1193 - 분수찾기 (0) | 2024.06.22 |
N2903 - 중앙 이동 알고리즘 (0) | 2024.06.15 |
Comments