Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Matrix1
- {
- public static void clearScreen()
- {
- System.out.print('\u000C');
- }
- private static boolean duple (int[][]a,int i, int j)
- {
- if (j==a[i].length)
- return true;
- else
- if (a[i][j]%2!=0)
- return false;
- else
- return (duple( a, i, j++));
- }
- private static boolean tri (int[][]a,int i, int j)
- {
- if (j==a[i].length)
- return true;
- else
- if (a[i][j]%3!=0)
- return false;
- else
- return (tri( a, i, j++));
- }
- public static boolean oddEvenRow(int[][]a,int i,int j)
- {
- if (i==a.length[j])
- return true;
- else
- if (i%2==0)
- return (duple (a));
- else
- return (tri (a));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment