본문/내용
/*반복문을 사용하여 2 ~ 5단까지 출력 */
for(int i=1; i<=9; i++)
{
for(int j=2; j<=5; j++)
/* 구구단 화면 출력 */
System.out.print(``+j+`*`+i+`=`+t.format(j*j));
/* 줄바꿈 */
System.out.println();
}
/* 사이 띄기 */
System.out.println();
/* 자리수 출력 */
DecimalFormat p = new DecimalFormat(`00 `);
/* 반복문을 사용하여 6 ~ 9단까지 출력 */
for(int k=1; k<=9; k++)
{
for(int y=6; y<=9; y++)
/* 구구단 화면 출력 */
System.out.print(``+y+`*`+k+`=`+p.format(y*k));
/* 줄 바꿈 */
System.out. ();
}
}
}