Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Stack
- Class
- Binary Search
- Math
- bit manipulation
- array
- 코테
- geometry
- Number Theory
- 구현
- Method
- Binary Tree
- implement
- 코딩테스트
- Tree
- simulation
- java
- Counting
- dynamic programming
- 자바
- Data Structure
- string
- greedy
- sorting
- hash table
- 파이썬
- SQL
- Matrix
- two pointers
- database
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 공배수 본문
1. Input
1) int number
2) int n
3) int m
2. Output
1) number가 n의 배수이면서 m의 배수이면 1을, 아니라면 0을 반환
3. Constraint
1) 10 ≤ number ≤ 100
2) 2 ≤ n, m < 10
4. Example
Input: number=60, n=2, m=3 -> Output: 1
5. Code
1) 첫 코드(2023/04/22)
return number%n==0 && number%m==0 ? 1 : 0;
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 문자열의 앞의 n글자 (0) | 2023.04.22 |
---|---|
[프로그래머스/Lv.0] 문자열로 변환 (0) | 2023.04.22 |
[프로그래머스/Lv.0] 문자열을 정수로 변환하기 (0) | 2023.04.22 |
[프로그래머스/Lv.0] n의 배수 (0) | 2023.04.22 |
[프로그래머스/Lv.0] 정수 부분 (0) | 2023.04.22 |