<문제 설명>

<나의 풀이>

<다른사람 풀이>
1)
using System;
public class Solution {
public int solution(int num1, int num2) {
return num1 % num2;
}
}
2)
using System;
public class Solution {
public int solution(int num1, int num2) {
int answer = num1 % num2;
return answer;
}
}
3)
using System;
public class Solution {
public int solution(int num1, int num2) {
int answer = 0;
if((num1 > 0 && num1 <= 100) && (num2 > 0 && num2 <= 100))
{
answer = num1 % num2;
}
return answer;
}
}'하루회고 ( *ฅ́˘ฅ̀*) > 프로그래머스 (๑ ́ᄇ`๑)' 카테고리의 다른 글
| C#)두 수의 합 (1) | 2024.06.09 |
|---|---|
| C#)나이 출력 (0) | 2024.06.08 |
| C#)숫자 비교하기 (0) | 2024.06.07 |
| C#)몫 구하기 (0) | 2024.06.05 |
| C#)두 수의 곱 (0) | 2024.06.04 |