<문제 설명>

<나의 풀이>

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