자바 프로그래밍/코드
while문 반복문
구리Guri
2020. 2. 10. 23:46
import java.util.Scanner;
public class homework_01 {
public static void main(String[] agrs) {
int i = 0;
int num = 0;
Scanner sc = new Scanner(System.in);
System.out.print("몇 번 반복할까요? ");
num = Integer.parseInt(sc.nextLine());
while(i<num) {
i++;
System.out.println("Hello java");
}
}
}