// 실습) n단을 입력받아, 구구단 출력
// 조건) printf() 메소드 사용
public class Test001 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n;
int i = 1;
System.out.print("구구단 입력: ");
n = sc.nextInt();
while (i <= 9) {
System.out.printf("%d*%d=%2d\n", n, i, n*i);
i++;
}
}
}
댓글 없음:
댓글 쓰기