반응형
#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;
}
짝수홀수 찾는 방법을 알고있다면 쉬울듯 하다.
반응형
'프로그래머스(코딩테스트 연습)' 카테고리의 다른 글
프로그래머스 홀짝에 따라 다른 값 변환하기 C++ (0) | 2023.09.23 |
---|---|
프로그래머스 공배수 C++ (0) | 2023.09.23 |
프로그래머스 두 수의 연산값 비교하기 C++ (0) | 2023.09.23 |
프로그래머스 더 크게 합치기 C++ (0) | 2023.09.22 |
프로그래머스 문자열 곱하기 C++ (0) | 2023.09.22 |