inblog logo
|
gyul
    자바 (JAVA)

    [자바 (JAVA)] 9. 구구단 스캐너 입력

    귤's avatar
    귤
    Feb 09, 2025
    [자바 (JAVA)] 9. 구구단 스캐너 입력
    // Scanner로 int a = 5; 를 입력 받으면 // 5단만 출력해라
    package ex03; import java.util.Scanner; public class Gugudan02 { public static void main(String[] args) { // Scanner로 int a = 5; 를 입력 받으면 // 5단만 출력해라 Scanner sc = new Scanner(System.in); System.out.println("숫자를 입력하세요 : "); int a = sc.nextInt(); for (int i = 1; i < 10; i++) { System.out.println(a + " * " + i + " = " + (a * i)); } } }
    notion image
    Share article

    gyul

    RSS·Powered by Inblog