public class Solution
    {
        public int RotatedDigits(int N)
        {
            int sum = 0;
            for (int i = 1; i <= N; i++)
            {
                var str = i.ToString();
                if ((str.Contains("2") || str.Contains("5") || str.Contains("6") || str.Contains("9")) && !str.Contains("3") && !str.Contains("4") && !str.Contains("7"))
                {
                    sum++;
                }
            }
            return sum;
        }
    }

 

posted on 2018-09-30 13:56  Sempron2800+  阅读(90)  评论(0编辑  收藏  举报