java编程输出星号

来源:互联网 发布:新速特软件站 编辑:程序博客网 时间:2024/06/05 05:10

*.*.
*..*..*.. 
*...*...*...*...
*....*....*....*....*.... 
*.....*.....*.....*.....*.....*.....
*......*......*......*......*......*......*......
*.......*.......*.......*.......*.......*.......*.......*.......

public class PrintStar {    public static void main(String[] args) {     // TODO, add your application code     for(int row=0;row<7;row++){  //输出数字      for(int star=0;star<=row+1;star++){       System.out.print("*");         for(int space=0;space<=row;space++){ //输出空格         System.out.print(".");        }      }      System.out.println();     }    }} 


 

原创粉丝点击