题解 | #挑7#
挑7
http://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
#include<stdio.h>
int main(){
int n,count=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
int m=i;
if(m%7==0)
count++;
else
while(m)
{
if(m%10==7)
{
count++;
break;
}
m/=10;
}
}
printf("%d",count);
return 0;
}