*홀수 단만 출력
package Operation;
public class operation2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int dan = 2;
int times = 1;
while(dan <= 9) {
if((dan % 2) != 0) {
dan++;
continue;
}
times = 1;
while(times <= 9) {
System.out.println(dan+"X"+times+"="+dan*times);
times++;
}
dan++;
System.out.println();
}
}
}
2X1=2
2X2=4
2X3=6
2X4=8
2X5=10
2X6=12
2X7=14
2X8=16
2X9=18
4X1=4
4X2=8
4X3=12
4X4=16
4X5=20
4X6=24
4X7=28
4X8=32
4X9=36
6X1=6
6X2=12
6X3=18
6X4=24
6X5=30
6X6=36
6X7=42
6X8=48
6X9=54
8X1=8
8X2=16
8X3=24
8X4=32
8X5=40
8X6=48
8X7=56
8X8=64
8X9=72
'JAVA' 카테고리의 다른 글
클래스와 객체-클래스 선언, 객체 생성 (0) | 2022.09.14 |
---|---|
상수, 리터럴, 형 변환 (0) | 2022.09.01 |
8, 10, 16 진수 (1) | 2022.09.01 |