[프로그래머스 | C# | Lv.0] 369게임

728x90

https://school.programmers.co.kr/learn/courses/30/lessons/120891?language=csharp

 

 

 

📝 나의 풀이

using System;

public class Solution {
    public int solution(int order) {
        int answer = 0;
        
        while (0<order){
            if( (order%10)%3 ==0 && order % 10 !=0 ){
                answer++;
            }
            order /=10;
        }
        return answer;
    }
}

 

728x90