Baekjoon(35)
-
[백준] JAVA 2588: 곱셈
https://www.acmicpc.net/problem/2588 Solution: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a, b, c; a = sc.nextInt(); b = sc.nextInt(); int one, two, three; one = b/100; two = b/10%10; three = b%10; System.out.println(a*three); System.out.println(a*two); System.out.println(a*one); System.out.println(a*b); } }
2022.02.04 -
[백준] JAVA 10430: 나머지
https://www.acmicpc.net/problem/10430 Solution: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A, B, C; A = sc.nextInt(); B = sc.nextInt(); C = sc.nextInt(); System.out.println((A+B)%C); System.out.println(((A%C) + (B%C))%C); System.out.println((A*B)%C); System.out.println(((A%C)*(B%C))%C); } }
2022.02.04 -
[백준] JAVA 18108: 1998년생인 내가 태국에서는 2541년생?!
https://www.acmicpc.net/problem/18108 Solution: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int year = Integer.parseInt(br.readLine()); System.out.print(year-543); br.close(); } }
2022.02.04 -
[백준] JAVA 10926: ??!
https://www.acmicpc.net/problem/10926 Solution: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String id = br.readLine(); System.out.print(id+"??!"); br.close(); } }
2022.02.04 -
[백준] JAVA 10869: 사칙연산
https://www.acmicpc.net/problem/10869 10869번: 사칙연산 두 자연수 A와 B가 주어진다. 이때, A+B, A-B, A*B, A/B(몫), A%B(나머지)를 출력하는 프로그램을 작성하시오. www.acmicpc.net Solution: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a, b; a = sc.nextInt(); b = sc.nextInt(); System.out.println(a+b); System.out.println(a-b); System.out.println(a*b); Sys..
2022.02.04 -
[백준] JAVA 10998: A×B
https://www.acmicpc.net/problem/10998 10998번: A×B 두 정수 A와 B를 입력받은 다음, A×B를 출력하는 프로그램을 작성하시오. www.acmicpc.net Solution: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a, b; a = sc.nextInt(); b = sc.nextInt(); System.out.println(a*b); } }
2022.02.04