๋ฐ์ํ
์ ์ฌ๋ฌธ์
- ๊ตฌ๊ตฌ๋จ
๋ชฉํ
์ฝ๋
package JavaBook;
import java.util.Scanner;
public class no3 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("๋จ์์
๋ ฅ : ");
int num = sc.nextInt();
System.out.println("์ด๋ ์๊น์ง ์ถ๋ ฅ : ");
int num2 = sc.nextInt();
System.out.println(num+"๋จ");
for(int i = 0; i < num2 ; i++) {
System.out.println(num+"*"+(i+1)+"="+(num*(i+1)));
}
}
}
๊ฒฐ๊ณผ
๋จ์์
๋ ฅ :
3
์ด๋ ์๊น์ง ์ถ๋ ฅ :
8
3๋จ
3*1=3
3*2=6
3*3=9
3*4=12
3*5=15
3*6=18
3*7=21
3*8=24
๋ฐ์ํ