Advertisement
finalshare

Untitled

Oct 24th, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement