package test01; public class 使用while打印直角三角形 { public static void main(String[] args) { // TODO Auto-generated method stub int i=1; int j=1; while(i<=3) { System.out.print("+"); i++; }while(j<1) { j++; }System.out.println(); } }
int i=1; while(i<=3) { int j=1; while(j<=i) { System.out.print("+"); j++; } System.out.println(); i++; }
int i=0;
while (i<=5){
int j=0;
while (j<i){
System.out.print("*");
j++;
}
System.out.println();
i++;
}