Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Q4_Main {
- public static void main(String[] args) {
- int[][] numbers = {{39,72,3 ,8 ,0 ,2 ,54},
- {18,16,13,47,41,87,65},
- {34,78,37,99,97,46,56},
- {51,50,12,31,58,63,18},
- {23,4 ,11,26,83,25,65}};
- } //end of main
- //answer q4.1
- public int place(int[][] nums, int x) {
- if(x<0 || x >= nums.length)
- return -1;
- int count = 0;
- for (int i = 0; i < x; i++) {
- count++;
- }
- return count;
- } //end of method
- //answer q4.2
- public void printAndCount(int[][] nums, int small, int bigger) {
- for (int i = small; i <= bigger; i++) {
- System.out.println(nums[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement