标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 26504 Accepted Submission(s): 9268
#include<stdio.h> #include<string.h> #include<stdlib.h> int s[1000005]; char str[8],a[2]="4",b[5]="62"; void init(){ for(int i=1;i<=1000000;i++){ itoa(i,str,10); if(strstr(str,a)!=NULL||strstr(str,b)!=NULL) s[i]=0; else s[i]=1; } } int main(){ int n,m; init(); while(scanf("%d%d",&m,&n)!=EOF){ if(n==0&&m==0) break; int sum=0; for(int i=m;i<=n;i++){ sum+=s[i]; } printf("%d\n",sum); } return 0; }
标签:
原文地址:http://www.cnblogs.com/13224ACMer/p/4790995.html