cggwz  

题目链接:失踪的7
水题,不解释。

#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        int n,ans;
        scanf("%d",&n);
        ans=n;
        for(int i=7;i<=n;i++){
            int x=i;
            while(x>0){
                if(x%10==7){
                    ans--;
                    break;
                }
                x/=10;
            }
        }
        printf("%d",ans);
        if(t!=0){
            printf("\n");
        }
    }
    return 0;
} 
posted on 2017-08-24 00:07  cggwz  阅读(210)  评论(0)    收藏  举报