Scanner scanner = new Scanner(System.in); while (scanner.hasNextBigInteger()) { long x = scanner.nextLong(); int y = scanner.nextInt(); if (x < 1) { break; } if (y < 1 || y > 5) { break; } double wordCount = Math.pow(26, y); int i = 0; double a = 0; while (a < x) { i++; a = wordCount * Math.pow(10, i); } System.out.println(i); } 用你的代码改了下取值类型
点赞 评论

相关推荐

程序员小白条:三方不签,不就是纯实习骗人吗,还是小公司,没毛了
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务