[프로그래머스] 공배수

Seah Lee·2023년 6월 19일
0

프로그래머스

목록 보기
10/57

class Solution {
    public int solution(int number, int n, int m) {
        
        if (number%n==0 & number%m==0) return 1;
        else return 0;
    }
}

[다른 사람의 풀이]

class Solution {
    public int solution(int number, int n, int m) {
        return number % n == 0 && number % m == 0 ? 1 : 0;
    }
}
profile
성장하는 개발자

0개의 댓글