๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Algorithm/CodeUp ๊ธฐ์ดˆ 100์ œ

[์ฝ”๋“œ์—… ๊ธฐ์ดˆ 100์ œ-JAVA] 1051~1060๋ฒˆ

by ์ฝ”๋”ฉํ•˜๋Š” ๋ถ•์–ด 2023. 3. 4.
๋ฐ˜์‘ํ˜•

1051๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a <= b) {
            System.out.println(1);
        } else {
            System.out.println(0);
        }
        pw.flush();
        pw.close();
    }
}

 

 

1052๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a != b) {
            System.out.println(1);
        } else {
            System.out.println(0);
        }
        pw.flush();
        pw.close();
    }
}

 

 

1053๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a == 0) {
            System.out.println(1);
        } else {
            System.out.println(0);
        }
        pw.flush();
        pw.close();
    }
}

 

 

1054๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        pw.printf("%d", a & b);
        pw.flush();
        pw.close();
    }
}

 

 

1055๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        pw.printf("%d", a | b);
        pw.flush();
        pw.close();
    }
}

 

 

1056๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a != b) {
            System.out.println(1);
        } else {
            System.out.println(0);
        }
        pw.flush();
        pw.close();
    }
}

 

 

1057๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a == b) {
            System.out.println(1);
        } else {
            System.out.println(0);
        }
        pw.flush();
        pw.close();
    }
}

 

 

1058๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a == 0 && b == 0) {
            System.out.println(1);
        } else {
            System.out.println(0);
        }
        pw.flush();
        pw.close();
    }
}

 

 

1059๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        pw.printf("%d", ~a);
        pw.flush();
        pw.close();
    }
}

 

 

1060๋ฒˆ

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        pw.println(a & b);
        pw.flush();
        pw.close();
    }
}
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€