반응형
Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

디케이

자바: 기초연산자(AND, XOR, OR) 본문

Java

자바: 기초연산자(AND, XOR, OR)

디케이형 2020. 11. 28. 00:42
반응형
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String[] cmd = sc.nextLine().split(" ");
		int a = Integer.parseInt(cmd[0]);
		int b = Integer.parseInt(cmd[1]);
		
		System.out.println(a^b);	//XOR
		System.out.println(a&b);	//AND
		System.out.println(a|b);	//OR
	}
}
반응형