70pts,help

B2078 含 k 个 3 的数

jfy2204 @ 2023-05-27 10:19:16

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

?????


by Geirangerfjard @ 2023-05-27 10:21:00

@jfy2204 开long long。


by Geirangerfjard @ 2023-05-27 10:21:20

@jfy2204 10的15次方int会爆的


by jfy2204 @ 2023-05-27 10:23:01

谢谢,过了
从未见过有人这么快回复


by Geirangerfjard @ 2023-05-27 10:24:12

@jfy2204 hh不客气


|