fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. const int HEIGHT = 15;
  5. const int OFFSET = 20;
  6. const int FREQ = 5;
  7.  
  8. for (int count = 0, i = 0; i < HEIGHT; ++i) {
  9. for (int j = 0; j < OFFSET - i; ++j)
  10. putchar(' ');
  11.  
  12. for (int j = 0; j < 2 * i + 1; ++j)
  13. putchar(count++ % FREQ ? '*' : 'o');
  14.  
  15. puts("");
  16. }
  17. }
  18.  
Success #stdin #stdout 0s 5412KB
stdin
Standard input is empty
stdout
                    o
                   ***
                  *o***
                 *o****o
                ****o****
               o****o****o
              ****o****o***
             *o****o****o***
            *o****o****o****o
           ****o****o****o****
          o****o****o****o****o
         ****o****o****o****o***
        *o****o****o****o****o***
       *o****o****o****o****o****o
      ****o****o****o****o****o****