denglixing0408 @ 2024-08-26 08:23:17
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
if(a%(b*3)==0){
cout<<"YES";}
else cout<<"NO";
return 0;
}
by hyl_____ @ 2024-08-26 08:27:02
再读读题吧
by hyl_____ @ 2024-08-26 08:27:17
理解错了
by Treap_qwq @ 2024-08-26 08:35:53
很明显也没有看数据范围
by Jason_Teng @ 2024-08-26 08:41:28
数是否有k个数为3的数位! 贴代码:
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main()//防止出错!
{
int n,s,k;
cin >> n >> k;
while(n)
{
if(n % 10 == 3) s++;
n = n / 10;
}
cout << (s == k?"YES":"NO") << endl;
return 0;
}
by Jason_Teng @ 2024-08-26 08:42:22
数是否有k个数为3的数位! 贴代码:
#include<bits/stdc++.h>
using namespace std;
signed main()//防止出错!
{
int n,s = 0,k;
cin >> n >> k;
while(n)
{
if(n % 10 == 3) s++;
n = n / 10;
}
cout << (s == k?"YES":"NO") << endl;
return 0;
}
by jzm0708 @ 2024-08-26 08:44:01
@denglixing0408
记得要开long long
代码已试无毒:
#include<bits/stdc++.h>
using namespace std;
long long a,k,c,cnt;
int main(){
cin>>a>>k;
while(a!=0){
c=a%10;
a/=10;
if(c==3)cnt++;
}
if(k==cnt)cout<<"YES";
else cout<<"NO";
return 0;
}
求关