Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. bool provjera(int mat[][vel],int br)
  2. {
  3. for(int i=0;i<br;i++)
  4. {
  5. for(int j=0;j<br;j++)
  6. {
  7. if(i==(br/2)&&j==(br/2))
  8. {
  9. continue;
  10. }
  11. else
  12. {
  13. if(i==j)//ZA GLAVNU DIJAGONALU
  14. {
  15. if(mat[i][j]!=mat[(br-1)-i][(br-1)-j])
  16. {
  17. return false;
  18. }
  19. }
  20. if(i+j==(br-1))//ZA SPOREDNU DIJAGONALU
  21. {
  22. if(mat[i][j]!=mat[(br-1)-i][(br-1)-j])
  23. {
  24. return false;
  25. }
  26. }
  27. if(i==(br/2))//ZA HORIZONTALU
  28. {
  29. if(mat[(br-1)/2][j]!=mat[(br-1)/2][(br-1)-j])
  30. {
  31. return false;
  32. }
  33. }
  34. if(j==(br/2))//ZA VERTIKALU
  35. {
  36. if(mat[i][(br-1)/2]!=mat[(br-1)-i][j])
  37. {
  38. return false;
  39. }
  40. }
  41. }
  42. }
  43. }
  44. return true;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement