자바_기초
For - 1 ~ 5까지 출력, 구구단
잠수콩
2019. 5. 21. 15:18
// 1 ~ 5까지 출력
public class ForEx {
public static void main(String[] args) {
for(int i=1; i<=5; i++) {
System.out.println(i);
}
System.out.println();
//구구단
for(int i = 1; i <= 9; i++) {
for (int j = 1; j <= 9; j++) {
System.out.println(i + " * " + j + " = " + (i * j));
}
System.out.println();
}
}
}