日期:2014-05-20  浏览次数:20733 次

一个简单的小问题
输出这样的一个东西:
*
**
* *
* *
* *
* *
* *
* *
* *
**********
谢谢各位高手啦!!!

------解决方案--------------------
public class CSDN
{
public static void drawSign(char sign, int rows)
{
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < rows; j++)
{
if (j == 0 || i == j || i == rows - 1)
System.out.print(sign);
else
System.out.print(' ');
}
System.out.println();
}
 }

public static void main(String[] args)
{
drawSign('*', 10);
}
}