题解 | 单组_spj判断YES与NO

单组_spj判断YES与NO

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

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc  = new Scanner(System.in);
        int n = sc.nextInt();
        if(n%2 == 0){
            System.out.println("NO");
        }
        if(n%2 == 1){
            System.out.println("YES");
        }
        sc.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:54 广东

相关推荐

评论
点赞
收藏
分享

创作者周榜

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