public class _08_NesteedLoop {
public static void main(String[] args) {
//์ด์ค ๋ฐ๋ณต๋ฌธ
//๋ณ (*) ์ฌ๊ฐํ
/*
*****
*****
*****
*****
*****
*/
for (int i=0;i<5;i++) {
for (int j = 0; j < 5; j++) {
System.out.print("*");
}
System.out.println();
}
/*
*
**
***
****
*/
for (int i=0;i<5;i++){
for(int j=0;j<=i;j++){
System.out.print("*");
}
System.out.println();
}
/*
*
**
***
****
*****
*/
for (int i=0; i<5; i++){
for ( int j=0; j< 4-i; j++){
System.out.print(" ");
}
for (int k = 0; k<=i;k++){
System.out.print("*");
}
System.out.println();
}
}
}
'๐ผ๋ฐฑ์ค๋ > Java ๋ฌธ๋ฒ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
04_10 Break (0) | 2023.07.05 |
---|---|
04_09 ๊ตฌ๊ตฌ๋จ (0) | 2023.07.05 |
04_07 do-while๋ฌธ (0) | 2023.07.05 |
04_06 while๋ฌธ (0) | 2023.07.04 |
04_05 for๋ฌธ (0) | 2023.07.04 |