题解 | #吃冰棍#

吃冰棍

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);
    }
}

全部评论

相关推荐

LZStarV:冲就好了,就算真的是字节也冲,面评脏了大不了等三四个月就淡了,而且等到那个时候实力进步了选择还多,何必拘泥于字节
点赞 评论 收藏
分享
10-21 17:42
酷酷的喜马拉雅山:你为什么发我的offer列表?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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