计算机二级辅导:Java等腰三角形例子
发布时间:2010/4/5 17:43:54 来源:城市学习网 编辑:admin
package test;
public class HappyChristmas
{
public static void main(Stringargs)
{
String str = "亲爱的朋友又是一年的圣诞节圣诞快乐每天都有好心情";
int x = str.length();
for(int i=1;ix;i++)
{
for (int t=0;t(x-i);t++)
{
System.out.print(" ");
}
for (int z=0;zi;z++)
{
String temp = str.substring(z,z+1);
System.out.print(temp);
try {
Thread.sleep(500);
}catch(Exception e){System.out.println("错误!");}
}
System.out.println();
}
}
}
: