.................

与运算---判断奇偶数

package _1_Bit_Operation;

import java.util.Scanner;

/**
 * @Auther: YuanJun
 * @Date: 2021/12/8 - 12 - 08 - 19:13
 * @Description: Bit_Operation
 */

//判断奇偶数

public class test1 {
    //这是一个main方法,是程序的入口:
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        if((n & 1) == 1){
            System.out.println(n + "是奇数");
        }
        else{
            System.out.println(n + "是偶数");
        }
    }
}

 

 

posted on 2021-12-09 10:11  么么^  阅读(105)  评论(0编辑  收藏  举报

Live2D