출처: https://bumcrush.tistory.com/182 [맑음때때로 여름]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
        Scanner sc = new Scanner(System.in);
        
        int a;
        
        System.out.print("숫자를 입력하세요 : ");
        a=sc.nextInt();
        
    
        
        if (a%2==0) {
            System.out.println("짝수입니다");
            }
        else {
            System.out.println("홀수입니다");
        }
cs

+ Recent posts