Advertisement
Guest User

matrica

a guest
Nov 1st, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. { int n, x, y, kvadrat[30][30];
  5. printf("Unesite n: ");
  6. scanf("%d", &n);
  7. if(1<=n && n<=30)
  8. { if(n%2==0 || n==0)
  9. { for(y=0; y<n; y++)
  10. { for(x=0; x<n; x++)
  11. { if(x==0 || y==0 || x==n || y==n) {kvadrat[x][y]='*';}
  12. else if(y==1 && x!=0 && x!=n) {kvadrat[x][y]=' ';}
  13. else if(x==1 && y!=0 && y!=n) {kvadrat[x][y]=' ';}
  14. else if() }
  15. }
  16. }
  17. else { printf("Greska: n mora zadovoljavati ogranicenja (1<=n<=30)");}
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement