언어공부/[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://ansohxxn.github.io/c%20sharp/ch8-1/