提交时间:2020-11-18 18:51:06

运行 ID: 9725

#include<bits/stdc++.h> using namespace std; int hasseven(int d){ int flag=0; do{ if(d%10==7) flag=1; d/=10; }while(d!=0); return flag; } int main(){ int n,m,num,count; cin>>n; for(int i=1;i<=n;i++){ cin>>num; m=0; count=0; for(int j=1;j<=num;j++){ m=hasseven(j); if(m==1) count++; } cout<<num-count<<endl; } return 0; }