Quantcast
Channel: CSDN博客推荐文章
Viewing all articles
Browse latest Browse all 35570

java编程输出星号

$
0
0

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

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();
     }
    }
} 


 

作者:jaycee110905 发表于2013-5-11 0:03:04 原文链接
阅读:0 评论:0 查看评论

Viewing all articles
Browse latest Browse all 35570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>