Coderforces Beautiful Matrix

来源:互联网 发布:南方大数据300a 编辑:程序博客网 时间:2024/06/14 20:54



http://codeforces.com/problemset/problem/263/A


import java.util.Scanner;public class Beautiful_Matrix {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);for(int i = 0; i < 5; i++) {for(int j = 0; j < 5; j++) {int k = scanner.nextInt();if(k == 1) {System.out.println(Math.abs(i-2) + Math.abs(j-2));}}}}}


原创粉丝点击