UKE了各位!

B2078 含 k 个 3 的数

Lish_Xizse @ 2021-09-25 11:30:59

#include<iostream>
using namespace std;
bool isdigit_x(int x,int k,int n){
    int ans;
    while(x!=0){
        int sum=x%10;
        if(sum==n){
            ans++;
        }
        x/=10;
    }
    if(ans==k)return true;
    else return false;
}
int main()
{
    int m,k;
    cin >> m >> k;
    if(isdigit_x(m,k,3)==true)cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

by Lish_Xizse @ 2021-09-25 11:31:35

先不管long long


by HYdroKomide @ 2021-09-25 11:32:17

@乄殇灬晓星辰 正常洛谷日爆现象,习惯就好


by Lish_Xizse @ 2021-09-25 11:33:16

@Kevin_FOS 行,谢谢


|