HDU 2022 海选女主角

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner in = new Scanner(System.in);
		while(in.hasNext()) {
			int m = in.nextInt();
			int n = in.nextInt();
			int arr[][] = new int[m][n];
			for(int i=0;i<m;i++) {
				for(int j=0;j<n;j++) {
					arr[i][j] = in.nextInt();
				}
			}
			SelectFamaleRole(arr);
		}
		

	}

	public static void SelectFamaleRole(int[][] arr) {
		int temp = arr[0][0];
		int row = 0;
		int column = 0;
		for(int i=0;i<arr.length;i++) {
			for(int j=0;j<arr[i].length;j++) {
				if(Math.abs(temp)<Math.abs(arr[i][j])) {
					temp = arr[i][j];
				}
			}
		}
		outer:
		for(int i=0;i<arr.length;i++) {
			for(int j=0;j<arr[i].length;j++) {
				if(arr[i][j]==temp) {
					row = i;
					column = j;
					break outer;
				}
			}
		}
		System.out.println((row+1)+" "+(column+1)+" "+temp);
	}

}

 

相关文章:

  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2021-06-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2021-11-21
相关资源
相似解决方案