Advertisement
bgeri74

Untitled

Mar 1st, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1.  
  2. typedef struct Point{
  3. int x, y;
  4. } POINT;
  5.  
  6. typedef struct Matrix9x9{
  7. POINT points[9][9];
  8.  
  9. bool fv1(){
  10. bool result = true;
  11. for(int i = 0; i < 9; i++){
  12. for(int j = 0; j < 9; j++){
  13. if(points[i][j].x > 8 || points[i][j].x < 1
  14. || points[i][j].y > 8 || points[i][j].y < 1){
  15. return false;
  16. }
  17. }
  18. }
  19. return result;
  20. }
  21.  
  22.  
  23. bool fv2(){
  24. bool result = true;
  25. for(int i = 0; i < 9; i++){
  26. for(int j = 0; j < 9; j++){
  27. if((points[i][j].x != 0 && points[i][j].x != 1)
  28. || (points[i][j].y != 0 && points[i][j].y != 1) ){
  29. return false;
  30.  
  31. }
  32. }
  33. }
  34.  
  35. return result;
  36. }
  37. }MATRIX_9x9;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement