언어공부/[BAEKJOON] C#

[프로그래머스] 등수 매기기_Lv.0

zzerou 2023. 3. 28. 22:35

 

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

 

프로그래머스

코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.

programmers.co.kr

using System;

public class Solution {
    public int[] solution(int[,] score) {
        int[] answer = new int[score.GetLength(0)];
        Array.Fill(answer,1);

        for (int i=0; i<score.GetLength(0); i++)
        {
           for (int j=0; j<score.GetLength(0); j++)
           {
               if (score[i,0] + score[i,1] > score[j,0] + score[j,1])
               {
                   answer[j]++;
               }
           }
        }
        return answer;
    }
}

참고

https://velog.io/@soldier1295/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-C-Lv.0-%EB%93%B1%EC%88%98-%EB%A7%A4%EA%B8%B0%EA%B8%B0

 

https://ansohxxn.github.io/c%20sharp/ch8-1/