大佬求教,为什么运行是对的,但是全红

B2078 含 k 个 3 的数

wuyu6688 @ 2024-03-11 21:34:12

 #include<iostream>
 using namespace std;
 int main(){
  int a,b,c,e=0;
    cin>>a>>b;
    c=a;
    while(c>0){
    if(c%10==3){
    e++;    
    }   
    c=c/10;
    }
    if(e==b){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
 }

by SZW_LXZ @ 2024-03-11 21:37:44

题目中是YES和NO而不是Yes和No


by SZW_LXZ @ 2024-03-11 21:39:01

#include<iostream>
using namespace std;
int main(){
//要开long long
long long a,b,c,e=0;
    cin>>a>>b;
    c=a;
    while(c){
        if(c%10==3){
            e++;    
        }   
        c/=10;
    }
    if(e==b){
        cout<<"YES";
    }else{
        cout<<"NO";
    }
    return 0;
 }

by wuyu6688 @ 2024-03-11 21:44:48

@SZW_LXZ 谢谢大哥


by Tqj0808 @ 2024-05-15 21:44:41

不是yes、no。是YES、NO


by JINGBAOWEN @ 2024-05-19 16:38:03

@wuyu6688 ug7xqyfc27v5q75g7nc7wfnwcdqno8a7fy8otcn 7tnwf8c7jaf9von93v3nct98v9qyv97


by wuyu6688 @ 2024-05-20 20:43:53

@JINGBAOWEN 这是什么东西?


|