Advertisement
1001b

Untitled

Dec 6th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include <stdlib.h>
  5.  
  6. int main()
  7. {
  8.  
  9. int n,i,j,kr;
  10. scanf("%d", &n);
  11. kr=n*2-1;
  12. for(i=0;i<kr;i++)
  13. {
  14. for(j=0;j<kr;j++)
  15. {
  16. int broj = i < j ? i : j;
  17. broj = broj < kr-i ? broj : kr-i-1;
  18. broj = broj < kr-j-1 ? broj : kr-j-1;
  19. printf("%d ",n-broj);
  20. }
  21. if(i==kr-1)break;
  22. printf("\n");
  23. }
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement