标签:code 模拟 return char ... while get cst names
纯模拟能过...
#include<cstdio> #include<cctype> #include<algorithm> using namespace std; inline int read(){ char c; while(c=getchar(),!isdigit(c)); int x=c-‘0‘; while(c=getchar(),isdigit(c)) x=x*10+c-‘0‘; return x; } int main(){ int n=read(),x=read(),tot=0; for(int i=1;i<=n;i+=1){ int now=i; while(now){ if(now%10==x) tot++; now/=10; } } printf("%d",tot); return 0; }
标签:code 模拟 return char ... while get cst names
原文地址:http://www.cnblogs.com/yuao/p/6974153.html