Rwilly @ 2021-12-17 19:13:47
直接用的字符串遍历
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
int a = sc.nextInt();
int sum = 0;
for (int i = 0; i < s.length(); i++) {
if(s.charAt(i) == '3'){
sum ++;
}
}
if(sum == a){
System.out.println("YES");
return;
}
System.out.println("NO");
}
}
by xiaomic @ 2021-12-17 19:15:33
评论区?
by ud2_ @ 2021-12-17 19:17:58
思路一样的代码不必发。
by Fgju @ 2021-12-17 19:19:07
@Rwilly
这位兄台,你是否有考虑过:
为什么题解代码要发在讨论区而不是提交为题解呢?
你谷苦C++
久矣,快去高举大Java
的义旗!
by PENGweic @ 2022-01-16 19:01:34
jbl