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

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

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

1041๋ฒˆ

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());
        char a = st.nextToken().charAt(0);
        a = (char) (a + 1);
        br.close();

        PrintWriter pw = new PrintWriter(System.out);
        pw.println(a);
        pw.flush();
        pw.close();
    }
}

 

 

1042๋ฒˆ

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

 

 

1043๋ฒˆ

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

 

 

1044๋ฒˆ

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);
        pw.println(a + 1);
        pw.flush();
        pw.close();
    }
}

 

 

1045๋ฒˆ

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.println(a - b);
        pw.println(a * b);
        pw.println(a / b);
        pw.println(a % b);
        pw.printf("%.2f", (double) a / b);
        pw.flush();
        pw.close();
    }
}

 

 

1046๋ฒˆ

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 + c);
        pw.printf("%.1f", (double) (a + b + c) / 3 );
        pw.flush();
        pw.close();
    }
}

 

 

1047๋ฒˆ

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.println(a << 1);
        pw.flush();
        pw.close();
    }
}

 

 

1048๋ฒˆ

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

 

 

1049๋ฒˆ

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

 

 

1050๋ฒˆ

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();
    }
}
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€