Guest User

Untitled

a guest
Jun 4th, 2015
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1.  
  2. public class Matrix1
  3. {
  4.     public static void clearScreen()
  5.     {
  6.                   System.out.print('\u000C');
  7.     }
  8.          
  9.     private static boolean  duple (int[][]a,int i, int j)
  10.     {
  11.         if (j==a[i].length)
  12.             return true;
  13.          else
  14.             if (a[i][j]%2!=0)    
  15.                 return false;
  16.             else
  17.                 return (duple( a, i, j++));
  18.     }
  19.      private static boolean  tri (int[][]a,int i, int j)
  20.      {
  21.         if (j==a[i].length)
  22.               return true;      
  23.           else  
  24.              if (a[i][j]%3!=0)
  25.                  return false;
  26.              else
  27.                   return (tri( a, i, j++));
  28.      }
  29.      public static boolean oddEvenRow(int[][]a,int i,int j)
  30.      {
  31.         if (i==a.length[j])
  32.             return true;
  33.          else
  34.             if (i%2==0)
  35.             return (duple (a));
  36.             else
  37.             return (tri (a));
  38.      }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment