Advertisement
Guest User

14.3

a guest
Nov 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public
  2. class ppj143{
  3. public static void main(String[]args){
  4.  
  5. int[][] tab3=new int[2][3];
  6. int[][] tab4=new int[2][3];
  7.  
  8. /*int[][] tab3= {
  9. {1,2,3},
  10. {4,5,6}
  11. };
  12.  
  13. int[][] tab4={
  14. {1,2,3},
  15. {4,5,6}
  16. };
  17. */
  18.  
  19.  
  20. ppj143.jestRowna(tab3,tab4);
  21. }
  22.  
  23.  
  24. static void jestRowna(int[][] tab1, int[][] tab2){
  25. boolean a=false;
  26. boolean b=false;
  27. boolean fin=false;
  28. int zliczanie=0;
  29. if(tab1.length==tab2.length && tab1[0].length==tab2[0].length ){
  30. a=true;}
  31. if(a==true){
  32. for(int i=0;i<tab1.length; i++){
  33. for(int j=0;j<tab1[0].length; j++){
  34. if(tab1[i][j] == tab2[i][j]){
  35. zliczanie++;
  36.  
  37. }
  38. }
  39. }
  40.  
  41. }
  42. if(zliczanie==(tab1.length*tab1[0].length)){
  43. b=true;
  44. System.out.println(zliczanie);}
  45. if(a==true && b==true){
  46. fin=true;}
  47.  
  48. System.out.println(fin);
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement