题解 | #吃冰棍#

吃冰棍

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

import java.util.Scanner;
import java.lang.Math;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = sc.nextInt();
        int x =sc.nextInt();
        int res = 0;
        for(int i = 0; i < n; i++){
            int a =sc.nextInt();
            res = Math.max(a | x , res);
        }
        System.out.print(res);
    }
}

全部评论

相关推荐

joecii:如果没有工资,那可能没有工资是这家公司最小的问题了
找实习记录
点赞 评论 收藏
分享
2025-12-15 12:50
河北工程大学
sta666:我也是这个国际商业化的,三天,一天一面,就通过了,不过我是后端实习生,好好面感觉能过。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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