fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i,j;
  5. for(i=1;i<=4;i++)
  6. {
  7. for(j=1;j<=7;j++)
  8. {
  9. if(j>=5-i&&j<=3+i)
  10. printf("* ");
  11. else
  12. printf(" ");
  13. }
  14. printf("\n");
  15. }
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
      *       
    * * *     
  * * * * *   
* * * * * * *