打印左上三角形

* * * * *
* * * *
* * *
* *
*

package prepare1;

public class Test {
	public static void main(String args[]) {
		for(int i = 1;i<=5 ;i++) {
			for(int j = 5;j>=i;j--) {//这里的j和左下三角形完全相反
				System.out.print("* ");//注意这里没有ln
			}
			System.out.println();
		}System.out.println();
	}
}

  

原文地址:https://www.cnblogs.com/ssC2H4/p/8530699.html