1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package  上机练习;
 
import  java.util.Scanner;
 
public  class  A03 {
 
     /**
      * @param args
      */
     public  static  void  main(String[] args) {
         // TODO Auto-generated method stub
         Scanner input =  new  Scanner (System.in);
         System.out.println( "请输入直角三角形的行数:" );
         int  rows = input.nextInt();
         for  ( int  i =  0 ; i <=rows; i++) {
             for  ( int  j =  0 ; j < 2 *i- 1 ; j++) {
                 System.out.print( "*" );
             }
             System.out.println();
         }
     }
 
}