public class Main {

public static void main(String[] args) {
int i, j;
for (i=2; i<=9; i++){
System.out.println("** 구구단 " + i + "단 **");
for (j=1; j<=9; j++) {
System.out.println(i + " x " + j + " = " + (i * j));
}
System.out.println("");
}
}
}


(출력 예시)

** 구구단 2단 **

2 x 1 = 2

2 x 2 = 4

2 x 3 = 6

2 x 4 = 8

...

+ Recent posts