Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7987 邓小龙 满足条件的数II C++ Accepted 0 MS 272 KB 453 2025-05-31 20:34:41

Tests(3/3):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int m,k; cin>>m>>k; bool f;//如果m包含k个3,则f=true,否则f=false int cnt=0;//统计m中3的个数 int t=m; while(t){//统计3的个数的 if(t%10==3) cnt++; t/=10; } if(cnt==k) f=true; else f=false; //判断m是否为19的倍数 if(m%19==0 && f) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }