首页 > 其他 > 详细

HDU 2089 不要62 --- 水题+打表

时间:2015-12-22 06:26:20      阅读:258      评论:0      收藏:0      [点我收藏+]
技术分享
/* HDU 2089 不要62 --- 水题+打表 */
#include <cstdio>
#include <cstring>

const int maxn = 1000005;
bool a[maxn];

int main()
{
    memset(a, 0, sizeof a);
    int j;
    for (int i = 1; i < maxn; ++i){
        j = i;
        while (j){
            if (j % 10 == 4 || j % 100 == 62){
                a[i] = 1;
                break;
            }
            j /= 10;
        }
    }
    int n, m, sum;
    while (scanf("%d%d", &n, &m) == 2 && (n+m)){
        sum = 0;
        for (int i = n; i <= m; ++i){
            sum += a[i];
        }
        printf("%d\n", m-n+1-sum);
    }

    return 0;
}
View Code

 

HDU 2089 不要62 --- 水题+打表

原文:http://www.cnblogs.com/tommychok/p/5065446.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!