Programmer:)
[ 프로그래머스 / C# ] 음양 더하기 본문
반응형
문제
https://programmers.co.kr/learn/courses/30/lessons/76501
using System;
public class Solution {
public int solution(int[] absolutes, bool[] signs) {
int answer = 0;
for(int i = 0; i < absolutes.Length; i++)
{
if(signs[i] == false)
absolutes[i] *= -1;
answer += absolutes[i];
}
return answer;
}
}
이번건 딱히 머가 없넹.
반응형
'프로그래머스 정복 > C#' 카테고리의 다른 글
[ 프로그래머스 / C# ] 과일 장수 (0) | 2022.11.16 |
---|---|
[ 프로그래머스 / C# ] K번째 수 (0) | 2022.03.29 |
[ 프로그래머스 / C# ] 없는숫자 더하기(Except) (0) | 2021.10.22 |
[ 프로그래머스 / C# ] 숫자 문자열과 영단어(2021 카카오 채용 연계 인턴쉽)(Dictionary) (0) | 2021.10.22 |
[ 프로그래머스 / C# ] 로또의 최고 순위와 최저 순위(for/foreach) (0) | 2021.10.18 |
Comments