70分,求助!

B2078 含 k 个 3 的数

wxrczs @ 2021-12-15 18:50:10

**各位大佬,哪里错了啊,只有70分```

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    int k;
    int s=0;
    cin>>n>>k;
    while(n>1){
        if(n%10==3){
            s++;
        }
        n/=10;
    } 
    if(s==k){
        cout<<"YES ";
    }
    else{
        cout<<"NO ";
    }
    return 0;
}

by j1ANGFeng @ 2021-12-15 18:52:53

@wxrxxs

要开long long


by wxrczs @ 2021-12-16 18:00:47

@jiangzimin6

谢谢大佬! AC了。


|