프로그래머스(코딩테스트 연습)

프로그래머스 n의 배수 C++

Dev_Jen 2023. 9. 23. 02:39
반응형
#include <string>
#include <vector>

using namespace std;

int solution(int num, int n) {
    int answer = 0;
    if(num%n == 0){
        answer = 1;
    }
    else{
        answer = 0;
    }
    
    return answer;
}

짝수홀수 찾는 방법을 알고있다면 쉬울듯 하다.

반응형