<문제설명>

<나의 풀이>

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