Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MencariPosArray {
- public static void main(String[] args) {
- int[][] arrayOfInts = {{32,87,3,589},
- {12,1076,2000,8},
- {622,127,77,955}};
- int b = 0,k = 0, i, j;
- for(i=0;i<arrayOfInts.length;i++) {
- for(j=0;j<arrayOfInts[i].length;j++) {
- if(arrayOfInts[i][j] == 12) {
- b = i;
- k = j;
- }
- }
- }
- System.out.println("12 ditemukan pada " + b + "," + k);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement