不知道为什么 第一题这样写只有55 public class test2 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int len = in.nextInt(); int count = 0; for(int i= 0; i < len; i++){ String temp = in.nextLine(); if(isReal(temp)){ count++; } } System.out.println(count); } public static boolean isReal(String str){ if(str.length() > 10) return false; return str.matches("^[a-zA-Z]+$"); } } 有大佬说说问题 吗
点赞 评论

相关推荐

2025-12-30 14:09
已编辑
北京交通大学 算法工程师
字节跳动 训练框架研发 (N+2) * (12 + 3) 硕士211
Crinton:训练框架遥遥领先
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务