LegoDrifter

Lab 6 - 5

Dec 9th, 2020
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. void elka(int n)
  2. {
  3. int i, j;
  4. for(i = 1; i<= n/2 + 1; i++)
  5. {
  6. for(j = 1; j <= n/2 - i + 1; j++)
  7. printf(" ");
  8. for(j = 1; j <= 2*i - 1; j++)
  9. printf("*");
  10. for(j = 1; j <= n/2 - i + 1; j++)
  11. printf(" ");
  12. printf("\n");
  13. }
  14. }
  15.  
  16. int main()
  17. {
  18. int n;
  19. scanf("%d", &n);
  20. elka(n);
  21. return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment