题解 | #[NOIP2013]记数问题#

[NOIP2013]记数问题

https://www.nowcoder.com/practice/28b2d9f2bf2c48de94a1297ed90e1732

#include <stdio.h>

int main()
{
    int n;
    int x;
    int count = 0;
    scanf("%d %d", &n, &x);
    for (int i = 1; i <= n; i++)
    {
        int temp = i;
        while(temp)
        {
            if(temp % 10 == x)
            {
                count++;
            }
            temp = temp / 10;
        }
    }
    printf("%d", count);
    return 0;

}
全部评论

相关推荐

zzzilik:四个月实习做了3个项目不觉得很假吗,真没必要写这么多吧我感觉挑点核心的重点写一下我感觉会好点
你的简历改到第几版了
点赞 评论 收藏
分享
11-03 14:57
西北大学 营销
Belltrix:其实就是每根转动一定的角度
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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