avatar
Untitled

Guest 55 16th May, 2019

                                           
                         #include <stdio.h>
#include <stdlib.h>

int main()
{
   int i,j,n;
   printf("nhap n: ");
   scanf("%d",&n);
   for(int i=0;i<=(2*n);i++)
   {printf("*");} printf("\n");

   for(int i=1;i<=n-1;i++)
   {
       for(int j=1;j<=n-i+1;j++)
       {printf("*");}
       for(int j=1;j<=2*i-1;j++)
       {printf(" ");}
       for(int j=1;j<=n-i+1;j++)
       {printf("*");}
        printf("\n");

   }
   for(int i=0;i<=(2*n);i++)
   {printf("*");}




    return 0;
}
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes