≈佐

—— 有恒则成。

统计

最新评论

java循环示例代码集锦--for循环 Four.

public class XingHaoFour
{
    
public static void main(String[] args)
    {
        
for(int i=10;i>0;i--)
        {
            
for(int j=i;j>1;j--)
            {
                System.out.print(
"  ");
            }
            
            
for(int n=i;n<11;n++)
            {
                System.out.print(
"*");
            }
        System.out.println(
"");
        }
    }
}

/* 
此图是打印结果: 

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

*/ 

posted on 2008-12-26 00:04 ≈佐 阅读(175) 评论(1)  编辑  收藏 所属分类: J2SE练习册

评论

# re: java循环示例代码集锦--for循环 Four. 2009-04-28 23:28 诸葛亮

谢谢了这些代码对我很有帮助  回复  更多评论