SHARE
TWEET

Untitled

finalshare Oct 24th, 2016 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.  
  5.     int i,j,n;
  6.     scanf("%d",&n);
  7.     n=n+1;
  8.     for (i=1;i<=(n);++i){
  9.         for (j=1;j<=(2*n+1);++j){
  10.             if (j<=(n+1-i) || j>=(n+1+i))
  11.                 printf(" ");
  12.             else
  13.                 printf("*");
  14.  
  15.         }
  16.         printf("\n");
  17.     }
  18.     for (i=n-1;i>=1;--i){
  19.         for (j=(2*n+1);j>=1;--j){
  20.             if (j<=(n+1-i) || j>=(n+1+i))
  21.                 printf(" ");
  22.             else
  23.                 printf("*");
  24.  
  25.         }
  26.         printf("\n");
  27.     }
  28.     return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top