大佬,请问我这样对不对啊 public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); String str = in.next(); Solution solution=new Solution(); System.out.println(solution.solu(str)); } public int solu(String str) { if (str.charAt(0) != '1') { return -1; } for (int i = 1; i < str.length(); i++) { if (str.charAt(i) != '3') { return -1; } } return str.length() - 1; } }
点赞 评论

相关推荐

点赞 评论 收藏
分享
2025-12-21 21:22
安徽农业大学 运营
程序员花海:实习和校招简历正确格式应该是教育背景+实习+项目经历+个人评价 其中项目经历注意要体现业务 实习经历里面的业务更是要自圆其说 简历模板尽可能保持干净整洁 不要太花哨的
实习简历求拷打
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务