用JAVA输出:
             *
          *     *
       *            *
          *      *
             * 帮忙大哥们!

解决方案 »

  1.   

    不知道你有什么要求。要用到循环什么都 。如果只是要求输出这个图形,就只要输出语句就行了。
    public class star {
    public static void main(String[] args) {
    System.out.println("    *");
    System.out.println("  *   *");
    System.out.println("*       *");
    System.out.println("  *   *");
    System.out.println("    *");
    }}
      

  2.   

    利用JAVA输出(用到循环):
                 *
              *     *
           *            *
              *      *
                 * 
      

  3.   

    参考:
    http://community.csdn.net/Expert/topic/5434/5434278.xml?temp=5.794924E-02
      

  4.   

    public class Test {
    public static void main(String[] args) {
    for (int i = 0; i < 5; i++) {
    if (i != 0 && i != 4)
    System.out.println("**");
    else
    System.out.println("*");
    }
    }
    }
      

  5.   

    public class print_star{
     public static void main(String[] args){
        int i=0,j=0;//i是星的行数
        for(i=0;i<5;i++){
          for(j=0;j<=i;j++){
            System.out.print("*");
          }
          System.out.print("\n");
        }
      }
    }
    这样就OK了.
      

  6.   

    好像不对呢:P 上面打出的是递增的星星.cycherr的才对耶.
    唉呀,丢人啊:'(
      

  7.   

    这才是答案虽然长了点public class xinxin {
    public static void main(String[] args) {
    for (int i = 1; i <= 5; i++) 
    {
    for(int j=1;j <= 9;j++ )
    {

    if( i==1&&j==5)
    System.out.print("*");
    else if( i==2&&(j==3||j==7) )
    System.out.print("*");
    else if( i==3&&(j==1||j==9) )
    System.out.print("*");
    else if( i==4&&(j==3||j==7) )
    System.out.print("*");
    else if( i==5&&j==5)
    System.out.println("*");
    else
    System.out.print(" ");
    }
    System.out.println(" ");
    }
    }
    }
      

  8.   

    class Test
    {
    public static void main(String[] args)
    {
    for(int i = 1 ; i < 6 ; i++)
    {
    for(int j = 1 ; j < 6 ; j++)
    {
    if((i%2==0 && j%2==0) || (i-j)==2 || (j-i)==2)
    {
    System.out.print("*");
    }
    else
    {
    System.out.print(" ");
    }
    }
    System.out.println("");
    }
    }
    }
      

  9.   

    这个比较灵活了import java.io.*;public class Test
    {
    public static void main(String[] args) throws IOException
    {
    try
    {
    System.out.print("input a number: ");
    int c = System.in.read() - '0';
    if(c%2!=0)
    {
    new Test().prt(c);//must input a odd number
    }
    else
    {
    System.out.println("You must input a odd number!");
    }
    }
    catch(IOException ioe)
    {
    ioe.printStackTrace();
    }
    } public void prt(int c)
    {
    for(int i = 1 , tmp = 0 ; i < c+1 ; i++)
    {
    tmp = i>(c+1)/2?((c+1)-(i)):i;
    for(int j = 1 ; j < c+1 ; j++)
    {
    if(j==((c+1)/2)+(tmp-1) || j==((c+1)/2)-(tmp-1))
    {
    System.out.print("*");
    }
    else
    {
    System.out.print(" ");
    }
    }
    System.out.println("");
    }
    }
    }