forked from dharmanshu1921/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintSum.java
More file actions
26 lines (23 loc) · 674 Bytes
/
Copy pathPrintSum.java
File metadata and controls
26 lines (23 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.packages;
import java.util.*;
public class PrintSum {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int rows= sc.nextInt();
int col = sc.nextInt();
int[][] numbers = new int[rows][col];
int x = sc.nextInt();
for(int i=0;i<rows;i++){
for(int j=0;j<col;j++){
numbers[i][j]= sc.nextInt();
}
}
for(int i=0;i<rows;i++){
for(int j= 0;j<col;j++){
if(numbers[i][j]==x){
System.out.println( i+ " "+j+" ");
}
}
}
}
}