题解 | #挑7#
挑7
http://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
#include <bits/stdc++.h>
using namespace std;
int shuzi(int i) {
while(i){
if(i%10==7) return 1;
i/=10;
}
return 0;
}
int main(){
int m;
set<int> s;
while(cin>>m){
s.clear();
for(int i=1;i<=m;++i){
if(shuzi(i)||i%7==0) s.insert(i);
}
cout<<s.size()<<endl;
}
return 0;
}