Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp10
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int[,] arr = new int[n, n];
- for (int i = 0; i < arr.GetLength(0); i++)
- {
- string el = Console.ReadLine();
- for (int j = 0; j < arr.GetLength(1); j++)
- {
- char symbol = el[j];
- arr[i, j] = symbol;
- }
- }
- string item = Console.ReadLine();
- bool isContains = true;
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- {
- if (arr[i, j] == char.Parse(item))
- {
- Console.WriteLine($"({i}, {j})");
- isContains = false;
- break;
- }
- }
- if (!isContains)
- {
- break;
- }
- }
- if (isContains)
- {
- Console.WriteLine($"{item} does not occur in the matrix");
- }
- }
- }
- }
Advertisement
RAW Paste Data
Copied
Advertisement