Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Advanced
- {
- class Program
- {
- static void Main(string[] args)
- {
- int dimentions = int.Parse(Console.ReadLine());
- int rows = dimentions;
- int cols = dimentions;
- var matrix = new int[rows, cols];
- for (int row = 0; row < rows; row++)
- {
- var currentRow = Console.ReadLine().ToArray();
- for (int col = 0; col < cols; col++)
- {
- matrix[row, col] = currentRow[col];
- }
- }
- char symbol = char.Parse(Console.ReadLine());
- for (int row = 0; row < rows; row++)
- {
- for (int col = 0; col < cols; col++)
- {
- if (matrix[row, col] == symbol)
- {
- Console.WriteLine($"({row}, {col})");
- return;
- }
- }
- }
- Console.WriteLine($"{symbol} does not occur in the matrix");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement