提交时间:2024-02-08 13:42:56
运行 ID: 40208
#include<iostream> using namespace std; int a[6]; int main() { int m,k; cin>>m>>k; if(m%19==0){ int S=0; a[1]=m/10000; a[2]=(m-10000*a[1])/1000; a[3]=(m-10000*a[1]-1000*a[2])/100; a[4]=(m-10000*a[1]-1000*a[2]-100*a[3])/10; a[5]=m%10; for(int i=1;i<=5;i++){ if(a[i]==3){ S++; } } if(S==k){ cout<<"YES"; } else{ cout<<"NO"; } } else{ cout<<"NO"; } return 0; }