article thumbnail image
Published 2021. 6. 8. 19:46
입력 예시
B

 

출력 예시
B*1=B
B*2=16
B*3=21
B*4=2C
B*5=37
B*6=42
B*7=4D
B*8=58
B*9=63
B*A=6E
B*B=79
B*C=84
B*D=8F
B*E=9A
B*F=A5

 

import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt(16);
        for(int i=1; i<16; i++){
            System.out.printf("%X*%X=%X\n", a, i, a*i);
        }
    }
}

 

복사했습니다!