public class Ex {
public static void main(String[] args) {
for(int i=2 ; i<=9 ; i++){
System.out.println();
for(int j=1 ; j<=9 ; j++){
System.out.print('\t');
if(i==5)
continue;
int result = i*j;
System.out.print(i+"*"+j+"="+result);
}
}
System.out.println();
}
}
- while문 소스
public class Ex2 {
public static void main(String[] args) {
int m = 2;
while(m<=9){
System.out.println();
int n = 1;
while(n<=9){
System.out.print('\t');
int result = m*n;
n++;
if(m==5)
continue;
System.out.print(m+"*"+n+"="+result);
}
m++;
}
System.out.println();
}
}
- 결과