728x90
https://school.programmers.co.kr/learn/courses/30/lessons/181933
📝 나의 풀이
using System;
public class Solution {
public int solution(int a, int b, bool flag) {
int answer = 0;
if(flag==true){
answer = a+b;
} else {
answer = a-b;
}
return answer;
}
}
728x90
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | Lv.0] 문자열의 앞의 n글자 (1) | 2023.08.13 |
---|---|
[프로그래머스 | Lv.0] 원소들의 곱과 합 (0) | 2023.08.13 |
[프로그래머스 | Lv.0] n 번째 원소까지 (0) | 2023.08.13 |
[프로그래머스 | Lv.0] 정수 부분 (0) | 2023.08.13 |
[프로그래머스 | Lv.0] 짝수는 싫어요 (0) | 2023.08.13 |