입력받은 수의 구구단 출력하기
Scanner sc = new Scanner (System.in);
System.out.println("숫자입력");
int num = sc.nextInt();
for(int i = 1 ; i <= 9; i++) { //for(정의;조건식;증감식)
System.out.printf("%dx%d=%d\t", num, i, num*i);
}//\t=띄어쓰기
sc.close();
'java > java exercise' 카테고리의 다른 글
Identify x and y are in the rectangle zone (0) | 2020.01.25 |
---|---|
It will add everything until you're satisfied. (0) | 2020.01.25 |
It will thank you until you're satisfied. (0) | 2020.01.25 |
Calculate and display Student Grades (0) | 2020.01.25 |
Print multiplication table (0) | 2020.01.25 |