Java等腰三角形例子

2014-11-14 23:30:36 · 作者: · 浏览: 31

  package test;


  public class HappyChristmas


  {


  public static void main(String [] args)


  {


  String str = "亲爱的朋友又是一年的圣诞节圣诞快乐每天都有好心情";


  int x = str.length();


  for(int i=1;i


  {


  for (int t=0;t<(x-i);t++)


  {


  System.out.print(" ");


  }


  for (int z=0;z


  {


  System.out.print(temp);


  try {


  Thread.sleep(500);


  }catch(Exception e){System.out.println("错误!");}


  }


  System.out.println();


  }


  }


  }


  编辑特别推荐: