https://www.acmicpc.net/problem/2588
문제
풀이
b의 입력값을 각 자릿수 별로 얻어와서 계산하는 방법으로 풀었다.
일의 자리 5는 385 % 10 = 5
십의 자리 8은 385 % 100 = 85. 이걸 다시 10으로 나누면, 85 / 10 = 8
백의 자리 3은 385 / 100 = 3
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());
int b = Integer.parseInt(br.readLine());
System.out.println(a*(b%10));
System.out.println(a*(b%100/10));
System.out.println(a*(b/100));
System.out.println(a*b);
br.close();
}
}