프로그래머스 C# 나이 출력(파이썬)

2023. 3. 30. 11:35C# 알고리즘 코딩(프로그래머스)

using System;

public class Solution {
    public int solution(int age) {
        if (age > 120 || age <= 0) 
        {
            throw new Exception("invalid param");
        }
        return 2023-age;
    }
}

 

 

/////

파이썬

////

 

 

def solution(age):
    return 2023-age