有没有编程题第一道测试用例通过,但是一提交都通过不了的?是什么问题呢 代码如下: Scanner scanner = new Scanner(System.in); HashMap<String, Integer> map = new HashMap<>(); String s = scanner.nextLine(); for (char c : s.toCharArray()){ if (c >= 'A' &;&; c <= 'Z'){ map.put("daxie", map.getOrDefault("daxie", 0)+1); }else if (c >= 'a' &;&; c <= 'z'){ map.put("xiaoxie", map.getOrDefault("xiaoxie", 0)+1); }else if (c >= '0' &;&; c <= '9'){ map.put("shuzi", map.getOrDefault("shuzi", 0)+1); }else if (c == ' '){ map.put("kongge", map.getOrDefault("kongge", 0)+1); } } System.out.print(map.get("daxie") + " "); System.out.print(map.get("xiaoxie") + " "); System.out.print(map.get("shuzi") + " "); System.out.print(map.get("kongge") + " ");
1 13

相关推荐

面了100年面试不知...:今年白菜这么多,冬天可以狂吃了
点赞 评论 收藏
分享
12-15 12:50
河北工程大学
sta666:我也是这个国际商业化的,三天,一天一面,就通过了,不过我是后端实习生,好好面感觉能过。
点赞 评论 收藏
分享
12-24 20:52
武汉大学 Java
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务