감자튀김 공장🍟

[Codeup]JAVA 1052~1061 본문

Algorithm/CodeUp

[Codeup]JAVA 1052~1061

Potato potage 2021. 3. 15. 15:10
반응형

[1052]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();

        if(a != b) {
            System.out.println(1);
        }
        else {
            System.out.println(0);
        }
    }
}

 

 

[1053]

import java.util.Scanner;

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

        int a = scanner.nextInt();

        if(a == 0 || a == 1) {
            if(a == 0) {
                System.out.println(1);
            }
            else {
                System.out.println(0);
            }
        }
    }
}

 

 

[1054]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();

        if((a == 0 || a == 1) && (b == 0 || b == 1)) {
            if(a == 1 && b == 1) {
                System.out.println(1);
            }
            else {
                System.out.println(0);
            }
        }
    }
}

 

 

[1055]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();

        if((a == 1 || a == 0) && (b == 1 || b == 0)) {
            if(a == 1 || b == 1) {
                System.out.println(1);
            }
            else {
                System.out.println(0);
            }
        }

    }
}

 

 

[1056]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();

        if((a == 1 || a == 0) && (b == 1 || b == 0)) {
            if(a != 1 && b == 1 || a == 1 && b != 1){
                System.out.println(1);
            }
            else
                System.out.println(0);
        }
    }
}

 

 

[1057]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();

        if((a == 1 || a == 0) && (b == 1 || b == 0)) {
            if(a == 1 && b == 1 || a == 0 && b == 0){
                System.out.println(1);
            }
            else
                System.out.println(0);
        }
    }
}

 

 

[1058]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();

        if((a == 1 || a == 0) && (b == 1 || b == 0)) {
            if(a != 1 && b != 1){
                System.out.println(1);
            }
            else
                System.out.println(0);
        }
    }
}

 

 

[1059]

import java.util.Scanner;

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

        int a = scanner.nextInt();

        System.out.println(~a);
    }
}

 

 

[1060]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();

        int x = a & b;
        System.out.println(x);
    }
}

 

 

[1061]

import java.util.Scanner;

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();

        int x = a | b;
        System.out.println(x);
    }
}
반응형

'Algorithm > CodeUp' 카테고리의 다른 글

[CodeUp]JAVA 1072~1081  (0) 2021.03.17
[CodeUp]JAVA 1062~1071  (0) 2021.03.16
[CodeUp]JAVA 1042~1051  (0) 2021.03.14
[CodeUp]JAVA 1032~1041  (0) 2021.03.13
[CodeUp]JAVA 1022~1031  (0) 2021.03.13
Comments