*
    * * *
  * * * * *
* * * * * * *
  * * * * *
    * * *
      *求简单算法!~

解决方案 »

  1.   

    LZ ,此图形可分上下两个,用for循环即可。还是自己动手比较好..鉴定OVer
      

  2.   

    先上边再下边啊
    上边四行,大概大概是这样
    for(i=1;i<=4;i++){
    for(int a=0;a<2*i-1;a=a++)
    {System.out.print("*");}
    System.out.println("");
    }
      

  3.   

    fuck了,居然写出 a=a++;把a= 去掉
      

  4.   

    用嵌套for循环打印
    用一个外循环打印换行-就是自动换行
    用两个并列内循环打印
    一个打印星号
    一个打印空格
      

  5.   

    public class Sample {
    public static void main(String[] args) {
    System.out.println("*");
    System.out.println(" ***");
    System.out.println(" *****");
    System.out.println("*******");
    System.out.println(" *****");
    System.out.println(" ***");
    System.out.println(" *");
    }
    }还有更简单的吗  亮亮代码
      

  6.   

       *
      ***
     *****
    *******
     *****
      ***
       *#include <iostream>
    #include <cmath>int main() {
    const int row = 5; // 5行,对于行对称的,使用绝对值来做比较好
    const int max = row / 2 + 1; for (int i = -max + 1; i < max; ++i) {
    for (int j = 0; j < abs(i); ++j, std::cout << " ");
    for (int j = 0; j < (max - abs(i)) * 2 - 1; ++j, std::cout << "*");
    std::cout << std::endl;
    } return 0;
    }