728x90
https://school.programmers.co.kr/learn/courses/30/lessons/181931
소스코드
using System;
public class Solution
{
public int solution(int a, int d, bool[] included)
{
int answer = 0;
for (int i = 0; i < included.Length; i++)
{
if (included[i])
answer += (a + (d * i));
}
return answer;
}
}
728x90
'코딩공부 > 프로그래머스' 카테고리의 다른 글
[프로그래머스]Lv.0 마지막 두 원소 C# (0) | 2023.06.02 |
---|---|
[프로그래머스]Lv.0 이어 붙인 수 C# (0) | 2023.06.02 |
[프로그래머스]Lv.0 원소들의 곱과 합 C# (0) | 2023.06.02 |
[프로그래머스]Lv.0 주사위 게임 2 C# (0) | 2023.06.02 |
[프로그래머스]Lv.0 코드 처리하기 C# (0) | 2023.06.02 |