提交时间:2020-11-18 18:55:41

运行 ID: 9755

#include<bits/stdc++.h> using namespace std; int hasSeven(int d); 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(1==m){ count++; } } cout<<num-count<<endl; } return 0; } int hasSeven(int d){ int flag=0; do{ if(d%10==7){ flag=1; } d=d/10; }while(d!=0); return flag; }