第一行有一个整数 。
如果 是奇数,输出 。如果 是偶数,输出 。
123
YES
124
no
import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int number = in.nextInt(); System.out.println(number%2==0 ? "NO" : "YES"); } }
int n = in.nextInt(); String r = ""; if(n%2==0){ r="no"; }else if(n%2!=0){ r="YES"; } System.out.println(r);
System.out.println((new Scanner(System.in).nextInt() & 1) == 0 ? "NO" : "YES");
print('YES' if int(input()) % 2 == 1 else 'NO')
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题