코딩테스트/[C#] 프로그래머스

[프로그래머스 | C# | Lv.0] 뒤에서 5등까지

냠냠쿠 2023. 9. 5. 20:21
728x90

https://school.programmers.co.kr/learn/courses/30/lessons/181853

📝 나의 풀이

using System;

public class Solution {
    public int[] solution(int[] num_list) {
        
        int[] answer = new int[5];
        
        Array.Sort(num_list);
        
        for(int i=0; i<answer.Length; i++){
            answer[i] = num_list[i];
        }
        
        return answer;
    }
}
728x90