题解 | #包含数字9的数#

包含数字9的数

http://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d

public class Main {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i < 2020; i++) {
            String num = String.valueOf(i);
            boolean contains = num.contains("9");
            if (contains){
                count++;
            }
        }
        System.out.println(count);
    }
}
全部评论

相关推荐

嵌入式的小白:简历都没过,说明简历匹配度不行,这个需要你看看投递的岗位描述,看人家需要什么技术,然后针对性的修改
0offer互助地
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务