Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public
- class ppj143{
- public static void main(String[]args){
- int[][] tab3=new int[2][3];
- int[][] tab4=new int[2][3];
- /*int[][] tab3= {
- {1,2,3},
- {4,5,6}
- };
- int[][] tab4={
- {1,2,3},
- {4,5,6}
- };
- */
- ppj143.jestRowna(tab3,tab4);
- }
- static void jestRowna(int[][] tab1, int[][] tab2){
- boolean a=false;
- boolean b=false;
- boolean fin=false;
- int zliczanie=0;
- if(tab1.length==tab2.length && tab1[0].length==tab2[0].length ){
- a=true;}
- if(a==true){
- for(int i=0;i<tab1.length; i++){
- for(int j=0;j<tab1[0].length; j++){
- if(tab1[i][j] == tab2[i][j]){
- zliczanie++;
- }
- }
- }
- }
- if(zliczanie==(tab1.length*tab1[0].length)){
- b=true;
- System.out.println(zliczanie);}
- if(a==true && b==true){
- fin=true;}
- System.out.println(fin);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement