提交时间:2020-11-18 18:55:57
运行 ID: 9757
#include<bits/stdc++.h> using namespace std; int hasSeven(int d){ int flag=0; do{ if(7==d%10){ flag=1; } d=d/10; } while(d!=0); return flag; } int main(){ int n,num,k=0; cin>>n; for(int i=1;i<=n;i++){ cin>>num; k=0; for(int j=1;j<=num;j++){ if(hasSeven(j)) k++; } cout<<num-k<<endl; } return 0; }