728x90
https://school.programmers.co.kr/learn/courses/30/lessons/120839
📝 나의 풀이
using System;
public class Solution {
public string solution(string rsp) {
string answer = "";
for(int i=0; i<rsp.Length; i++){
string tmp = rsp.Substring(i,1);
if(tmp=="2"){
answer += "0";
} else if (tmp=="0"){
answer += "5";
} else {
answer += "2";
}
}
return answer;
}
}
728x90
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | Lv.0] 배열 회전시키기 (0) | 2023.09.12 |
---|---|
[프로그래머스 | C# | Lv.0] 피자 나눠 먹기 (2) (1) | 2023.09.12 |
[프로그래머스 | C# | Lv.0] 문자열 반복해서 출력하기 (0) | 2023.09.11 |
[프로그래머스 | C# | Lv.0] a와 b 출력하기 (0) | 2023.09.10 |
[프로그래머스 | C# | Lv.0] 문자열 출력하기 (0) | 2023.09.10 |