728x90
https://www.acmicpc.net/problem/2588
Buffer 이용해서 곱셈 계산
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 A = Integer.parseInt(br.readLine());
String B = br.readLine();
char[] b = B.toCharArray();
System.out.println(A * (b[2]-'0'));
System.out.println(A * (b[1]-'0'));
System.out.println(A * (b[0]-'0'));
System.out.println(A * Integer.parseInt(B));
}
}
728x90
'Algorithm' 카테고리의 다른 글
[Java] 백준 2475번 검증수 (0) | 2021.10.30 |
---|---|
[Java] 백준 2558번 A+B - 2 (0) | 2021.10.30 |
[Java] 백준 10998번: A x B (0) | 2021.10.29 |
[Java] 백준 10869번: 사칙연산 (0) | 2021.10.29 |
[Java] 10430번: 나머지 (0) | 2021.10.28 |