fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int main(int argc, char** argv) {
  6. int x, y;
  7. for (y = 0; y <= 5; y++) {
  8. for (x = 0; x < y; x++) {
  9. for (int i = 0; x == 0 && i < (5 - y); ++i)
  10. cout << ' ';
  11. cout << " *";
  12. }
  13. cout << '\n';
  14. }
  15. getchar();
  16. return 0;
  17. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
     *
    * *
   * * *
  * * * *
 * * * * *