school.programmers.co.kr
문제

기본적으로 주어진 코드 :
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
int solution(int num1, int num2) {
int answer = 0;
return answer;
}
정답
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
int solution(int num1, int num2) {
int answer = 0;
if (num1 == num2) {
answer = 1;
} else {
answer = -1;
}
return answer;
}
Share article