1到10的5次方里就4个完数,直接打表输出就行。

Problem A

https://www.nowcoder.com/practice/ee083fda4b39446d9aa543b1039475b8

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = {6, 28, 496, 8128};
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            for (int num : nums) {
                if (num >= a && num <= b) {
                    System.out.println(num);
                }
            }
        }
    }
}

全部评论

相关推荐

合适才能收到offe...:招聘上写这些态度傲慢的就别继续招呼了,你会发现hr和面试官挺神的,本来求职艰难就可能影响一些心态了,你去这种公司面试的话,整个心态会炸的。
点赞 评论 收藏
分享
02-04 17:01
南昌大学 Java
牛客96763241...:拿插件直接投就完了,这玩意看运气的
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务