ネスティング

ビッグトラップ小さな円:

1つの パッケージcn.itcast.day04_for。
2  
3  パブリック クラスTEST1 {
 4  
5      / * 
6       *案例一:
 7       * *****
 8       * *****
 9       * *****
 10       * *****
 11       * / 
12  
13      公衆 スタティック ボイドメイン(文字列[]引数){
 14          のためのint型 i = 0; iが5 <; Iは++ ){
 15              のためにINT J = 0; J <5; J ++ ){
 16                  System.out.print( "*");
17              }
 18              のSystem.out.println();
19          }
 20      } 
21 }
1つの パッケージcn.itcast.day04_for。
2  
3  パブリック クラスTEST2 {
 4  
5      パブリック 静的 ボイドメイン(文字列[]引数){
 6  
7          / * 
8           *案例二:
 9           * *****
 10           * ****
 11           * ***
 12           * **
 13           *
 14           * / 
15          のためのint型 i = 0; iが++; iが5 < ){
 16              のためにINT J = 0; J <5 - I; J ++ ){
 17                 System.out.print( "*" );
18              }
 19              のSystem.out.println();
20          }
 21  
22      }
 23 }
1つの パッケージcn.itcast.day04_for。
2  
3  パブリック クラスTEST3 {
 4  
5      パブリック 静的 ボイドメイン(文字列[]引数){
 6  
7          / * 
8           *案例三:
 9           *
 10           * **
 11           * ***
 12           * ****
 13           * ** ***
 14           *
 15           * / 
16  
17          のためにint型、iは5 <; I = 0 iは++ ){
 18              のためにINTJ = 0; J <= I; J ++ ){
 19                  System.out.print( "*" );
20              }
 21              のSystem.out.println();
22          }
 23  
24      }
 25 }
1つの パッケージcn.itcast.day04_for。
2  
3  パブリック クラスTEST4 {
 4  
5      パブリック 静的 ボイドメイン(文字列[]引数){
 6  
7          / * 
8           *案例四:
 9           * 54321
 10           * 5432
 11           * 543
 12           * 54
 13           * 5
 14           *
 15           * / 
16  
17          以下のためにint型、iは5 <; I = 0 iは++ ){
 18              のためにINTJ = 5; J> I; j-- ){
 19                  System.out.print(J)。
20              }
 21              のSystem.out.println();
22          }
 23  
24      }
 25 }
1つの パッケージcn.itcast.day04_for。
2  
3  パブリック クラスTEST5 {
 4  
5      パブリック 静的 ボイドメイン(文字列[]引数){
 6  
7          / * 
8           *案例五:
 9           * 1
 10           * 12
 11           * 123
 12           * 1234
 13           * 12345
 14           * / 
15  
16          のためにint型 i = 0; iが5 <; Iは++ ){
 17              のためにINT J = 0; J <= I; J ++ ){
18                  System.out.print(J + 1 )。
19              }
 20              のSystem.out.println();
21          }
 22  
23      }
 24  
25 }
1  パッケージcn.itcast.day04_for;
 2  
3。 パブリック クラスTEST6 {
 4。     公共 静的 ボイドメイン(文字列[]引数){
 5。 
6。         / * 
7           * 6例:
 8           *印刷乗算表
 9           *
 10           * / 
11  
12である         ためINT I = 1; I <= 9; I ++ ){
 13がある             ためINT。; J <=はI J ++ J = 1 ){
 14                  System.out.printの(I + "*" + J + "=" + I + J * "\ T" );
 15              }
16              のSystem.out.println();
17          }
 18      }
 19 }
1つの パッケージcn.itcast.day04_for。
2  
3  パブリック クラスTEST7 {
 4  
5      パブリック 静的 ボイドメイン(文字列[]引数){
 6  
7          / * 
8           *案例七:
 9           * * * * * *
 10           * * * * *
 11           * * * *
 12           * * *
 13           *
 14           * / 
15  
16          のためにint型 i = 0; iは<5; I ++ ){
 17              のためのint型 J = 0; J <I、J ++){
 18                  System.out.print(」 " )。
19              }
 20              のためにINT J = 0; J <5-I; J ++ ){
 21                  System.out.print( "*" )。
22              }
 23              のSystem.out.println();
24          }
 25      }
 26 }

 

おすすめ

転載: www.cnblogs.com/xuan-lin/p/11230919.html