网易雷火第二题投机取巧AC60% import java.util.Scanner; public class Main2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] strings = sc.nextLine().split(","); System.out.println(find(strings)); } private static int find(String[] strings) { int count = 0; for (int i = 0; i < strings[0].length(); i++) { if (strings[0].charAt(i) == '3') count ++; } if (count > 7) return 15; else if(count < 3) { return 8; } else if(count == 4) { return 9; } else if(count == 5) { return 10; } return 11; } /* * 8 10% * 9 10% * 10 10% * 11 20% * 12 10% * 13 10% * 14 10% * 15 20% * 所有测试函数的字符串的位数为16 */ }
点赞 评论

相关推荐

05-12 11:09
已编辑
门头沟学院 后端
已注销:没必要放这么多专业技能的描述。这些应该是默认已会的,写这么多行感觉在凑内容。项目这块感觉再包装包装吧,换个名字,虽然大家的项目基本都是网上套壳的,但是你这也太明显了。放一个业务项目,再放一个技术项目。技术项目,例如中间件的一些扩展和尝试。
点赞 评论 收藏
分享
秋盈丶:后续:我在宿舍群里和大学同学分享了这事儿,我好兄弟气不过把他挂到某脉上了,10w+阅读量几百条评论,直接干成精品贴子,爽
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务