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

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

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

1061๋ฒˆ

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();
    }
}

 

 

1062๋ฒˆ

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();
    }
}

 

 

1063๋ฒˆ

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 ? a : b);
        pw.flush();
        pw.close();
    }
}

 

 

1064๋ฒˆ

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());
        int c = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        pw.println((a>b ? b:a) > c ? c : (a>b ? b:a));
        pw.flush();
        pw.close();
    }
}

 

 

1065๋ฒˆ

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());
        int c = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a%2 == 0) pw.println(a);
        if (b%2 == 0) pw.println(b);
        if (c%2 == 0) pw.println(c);
        pw.flush();
        pw.close();
    }
}

 

 

1066๋ฒˆ

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());
        int c = Integer.parseInt(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a%2 == 0) {
            pw.println("even");
        } else {
            pw.println("odd");
        }
        if (b%2 == 0) {
            pw.println("even");
        } else {
            pw.println("odd");
        }
        if (c%2 == 0) {
            pw.println("even");
        } else {
            pw.println("odd");
        }
        pw.flush();
        pw.close();
    }
}

 

 

1067๋ฒˆ

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());
        long a = Long.parseLong(st.nextToken());
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        if (a >= 0) {
            System.out.println("plus");
        } else {
            System.out.println("minus");
        }
        if (a % 2 == 0) {
            System.out.println("even");
        } else {
            System.out.println("odd");
        }
        pw.flush();
        pw.close();
    }
}

 

 

1068๋ฒˆ

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 >= 90) {
            System.out.println("A");
        }
        else if (a >= 70) {
            System.out.println("B");
        }
        else if (a >= 40) {
            System.out.println("C");
        }
        else if (a >= 0) {
            System.out.println("D");
        }
        pw.flush();
        pw.close();
    }
}

 

 

1069๋ฒˆ

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());
        String a = st.nextToken();
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        switch (a) {
            case "A":
                System.out.println("best!!!");
                break;
            case "B":
                System.out.println("good!!");
                break;
            case "C":
                System.out.println("run!");
                break;
            case "D":
                System.out.println("slowly~");
                break;
            default:
                System.out.println("what?");
                break;
        }
        pw.flush();
        pw.close();
    }
}

 

 

1070๋ฒˆ

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());
        String a = st.nextToken();
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        switch (a) {
            case "12":
            case "1":
            case "2":
                System.out.println("winter");
                break;
            case "3":
            case "4":
            case "5":
                System.out.println("spring");
                break;
            case "6":
            case "7":
            case "8":
                System.out.println("summer");
                break;
            case "9":
            case "10":
            case "11":
                System.out.println("fall");
                break;
        }
        pw.flush();
        pw.close();
    }
}
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€