using System;
public class Solution {
public int solution(int[] num_list) {
int first = 0;
int second = 0;
for (int i = 0; i < num_list.Length; i++)
{
if (num_list[i] % 2 == 0)
first = (int)(10 * first) + (num_list[i]);
else
second = (int)(10 * second) + (num_list[i]);
}
return first + second;
}
}
'프로그래머스 > Lv.0' 카테고리의 다른 글
[프로그래머스 C#] 공 던지기 (0) | 2023.09.05 |
---|---|
[프로그래머스 C#] 커피 심부름 (1) | 2023.09.05 |
[프로그래머스 C#] 7의 개수 (0) | 2023.09.05 |
[프로그래머스 C#] 컨트롤 제트 (0) | 2023.09.05 |
[프로그래머스 C#] A로 B 만들기 (0) | 2023.09.05 |