当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
计算机二级辅导: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();
  }
  }
  }
  :
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved