반응형
# 1053
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
if (a == 0) {
System.out.println(1);
} else if (a == 1) {
System.out.println(0);
}
}
}
# 1054
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a == 1 && b == 1) {
System.out.println(1);
} else {
System.out.println(0);
}
}
}
# 1055
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a == 1 || b == 1) {
System.out.println(1);
} else {
System.out.println(0);
}
}
}
# 1056
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a != b) {
System.out.println(1);
} else {
System.out.println(0);
}
}
}
# 1057
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a == b) {
System.out.println(1);
} else {
System.out.println(0);
}
}
}
# 1058
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a == 0 && b == 0) {
System.out.println(1);
} else {
System.out.println(0);
}
}
}
# 1059
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.printf("%d", ~n);
}
}
# 1060
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.printf("%d", a&b);
}
}
# 1061
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.printf("%d", a|b);
}
}
# 1062
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.printf("%d", a ^ b);
}
}
반응형
'개인 공부 > JAVA' 카테고리의 다른 글
[JAVA] Code Up 기초 100제 (1073 ~ 1082) (0) | 2021.06.24 |
---|---|
[JAVA] Code Up 기초 100제 (1063 ~ 1072) (0) | 2021.06.23 |
[JAVA] Code Up 기초 100제 (1043 ~ 1052) (0) | 2021.06.21 |
[JAVA] Code Up 기초 100제 (1033 ~ 1042) (0) | 2021.06.20 |
[JAVA] Code Up 기초 100제 (1023 ~ 1032) (0) | 2021.06.19 |