자바 생기초질문 흑...
EthanChoi
4년 전
조회 1,803
선배님들 자바에서 for문 변수설정시 for문안에 하면 안되는이유가 뭔지아시나요?? 구구단 출력문제입니다
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt(); //3
//int n = 1; //요건되고
for(int i = 0; i < 9;i++) {
int n = 1; //요건왜 안될까요??
System.out.println(N + " * " + n + " = " + (N * n));
n++;
}
}
}
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
답변을 작성하려면 로그인이 필요합니다.
로그인