코딩테스트/[C#] 프로그래머스

[프로그래머스 | C# | Lv.0] 외계행성의 나이

냠냠쿠 2023. 10. 5. 19:08
728x90

 

https://school.programmers.co.kr/learn/courses/30/lessons/120834

📝 나의 풀이

using System;

public class Solution {
    public string solution(int age) {
        
        string answer = "";
        
        while(age != 0) {
            answer = (char)(age % 10 + 97) + answer;
            age/= 10;
        }   
        
        return answer;
    }
}
728x90