본문 바로가기
문제풀이/코드업

[CodeUp] 1050 - 1059 문제 풀이(Java)

by chan10 2021. 3. 14.

CodeUp-1050

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println(a==b?1:0);
}


CodeUp-1051

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println(a<=b?1:0);
}


CodeUp-1052

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println(a!=b?1:0);
}


CodeUp-1053

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    System.out.println(a==0?1:0);
}


CodeUp-1054

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println(a==1&&b==1?1:0);
}


CodeUp-1055

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println(a==1||b==1?1:0);
}


CodeUp-1056

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println(a!=b?1:0);
}


CodeUp-1057

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println((a==1&&b==1)||(a==0&&b==0)?1:0);
}


CodeUp-1058

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    System.out.println(a==0&&b==0?1:0);
}


CodeUp-1059

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    System.out.println(~a);
}