728x90 숫자인덱스1 자바 세자리 연산 과정 백준알고리즘 2588 (1) a = 472, (2) b = 385 기준 값을 10으로 반복해 나눈 값을 10으로 나머지 연산을 하면 일의 자리를 얻을 수 있다. import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int tmp = b; for (int i = 0; i 0 ? tmp / 10 : b); System.out.println(a * (tmp % 10)); } System.out.println(a * b); } } 2021. 11. 25. 이전 1 다음 728x90