Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace Tier_II
- {
- class Program
- {
- public static int[][] ReadDoubleMatrix(string path)
- {
- StreamReader f = new StreamReader(path);
- int m = int.Parse(f.ReadLine());
- int[][] matrix = new int[m][];
- for (int i = 0; i < matrix.Length; i++)
- {
- string[] strs = f.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- int[] ai = new int[strs.Length];
- for (int j = 0; j < ai.Length; j++)
- {
- ai[j] = int.Parse(strs[j]);
- }
- matrix[i] = ai;
- }
- f.Close();
- return matrix;
- }
- static void Main(string[] args)
- {
- string path = Console.ReadLine();
- int max = -1;
- int[][] matrix = ReadDoubleMatrix(path);
- for (int i = 0; i<matrix.Length;i++)
- {
- int[] matrix1 = matrix[i];
- for(int j=0; j<matrix1.Length;j++)
- {
- if (matrix1[j] == 0)
- {
- max = i;
- continue;
- }
- }
- }
- Console.WriteLine(max);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement