标签:水题
题意:。。
水题
代码:
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; int s[10]; int ans[1000005] = {0, 1}; int is(int n){ //n = 62; int pre = 0, cur = 0, i; while(n){ pre = cur; cur = n%10; n /= 10; if(cur == 4||(cur == 6&&pre == 2)) return 1; } return 0; } int f() { int i; for(i = 1; i < 1000005; i ++){ if(is(i)){ ans[i] = ans[i-1]; } else ans[i] = ans[i-1]+1; } } int main() { int n, m; f(); while(scanf("%d%d", &n, &m), n, m){ printf("%d\n", ans[m]-ans[n-1]); } return 0; }题目链接:点击打开链接
hdoj 2089 不要62 【打表】,布布扣,bubuko.com
标签:水题
原文地址:http://blog.csdn.net/shengweisong/article/details/38687313