题解 | 牛牛数数

牛牛数数

https://www.nowcoder.com/practice/03a3cc96fa4847b387bf58bb800d67cf?tpId=383&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        if(i%4!=0){
            int temp=i;  
            while (temp>0) {     
                if(temp%10 ==4){break;}
                temp/=10; }                  
                if(temp == 0) {cout << i << endl;}  
                    }   
                        }
}       
    
   


全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务