题解 | 单组_spj判断YES与NO

单组_spj判断YES与NO

https://www.nowcoder.com/practice/4dffedb2a0734a0e9ce759f2eaeeda65

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long num = in.nextLong();
        if(num%2==0){
            System.out.println("NO");
        }
        else{
            System.out.println("YES");
        }
        in.close();
    }
}

全部评论
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); long n = in.nextLong(); if((n&1) > 0){ System.out.println("YES"); } else { System.out.println("NO"); } } }
点赞 回复 分享
发布于 06-24 10:53 广东

相关推荐

不愿透露姓名的神秘牛友
06-27 20:55
点赞 评论 收藏
分享
牛客38347925...:9,2学生暑期实习失利开始投小厂,给这群人整自信了
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
昨天 17:30
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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