zhenshijuruo @ 2024-09-15 14:13:11
上代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
if(k*3>=n)cout<<"YES";
else cout<<"NO";
return 0;
}
呃不知道是哪里错了,还是60分
by hexuchen @ 2024-09-15 14:14:49
@zhenshijuruo 请读题。如果题目读不懂请看样例。
by scratch_szc @ 2024-09-15 14:24:19
@zhenshijuruo 《《含有k个三的》》
by zhenshijuruo @ 2024-09-15 14:25:25
@hexuchen 呃是指把这个数看成字符串然后看字符串里有没有k个3的意思吗
by scratch_szc @ 2024-09-15 14:27:46
@zhenshijuruo yes
by hexuchen @ 2024-09-15 14:28:43
@zhenshijuruo 是的
by scratch_szc @ 2024-09-15 14:31:43
萌新求助!为什么40分(滑稽)
#include<bits/stdc++.h>
using namespace std;
int main(){
string n;
int p;
int t;
cin>>n>>p;
for(int i=0;i<n.size();i++)if(n[i]==3+'0')t++;
if(t==p)cout<<"YES";
else cout<<"NO";
}
@hexuchen @zhenshijuruo
by zhenshijuruo @ 2024-09-15 14:39:32
@scratch_szc 虽然但是……我不是萌新(是某xxs
by hexuchen @ 2024-09-15 14:41:00
@scratch_szc t 没有赋值
by zhenshijuruo @ 2024-09-15 14:50:56
@hexuchen 谢谢大佬!!!
by TimADE @ 2024-09-15 14:51:19
@zhenshijuruo
@scratch_szc
#include<iostream>
using namespace std;
int main(){
long long m;
int k;
cin>>m>>k;
int a=0;
while(m!=0){
if(m%10==3)
a++;
m/=10;
}
if(k==a)
cout << "YES";
else
cout << "NO";
return 0;
}