用while语句怎样打印三角形哪里错了
public class HelloWorld{ public static void main(String[]args){ System.out.println("打印三角形:"); while(int i=1;i<=5;i++){ while(int j=1;j<=i;j++){ System.out.print("*"); } System.out.println(); } } }
public class HelloWorld{ public static void main(String[]args){ System.out.println("打印三角形:"); while(int i=1;i<=5;i++){ while(int j=1;j<=i;j++){ System.out.print("*"); } System.out.println(); } } }
2016-12-04
举报