Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] a = new int[5, 4] { { 1, 1, 1, 0 }, { -2, -3, 2, 1 }, { 2, -5, 0, -1 }, { -3, 4, 6, 2 }, { -6, 6, 3, 4 } };
- Console.WriteLine("numer wiersza z maksymalnym elementem = " + gdzieMax(a));
- Console.ReadKey();
- }
- static int gdzieMax(int[,] a)
- {
- int wynik = 0, licznik = 0, najwieksza = int.MaxValue;
- for (int i = 0; i < 5; i++)
- {
- for (int j = 0; j < 3; j++)
- {
- if (a[i, j] < najwieksza) wynik = licznik;
- }
- licznik++;
- }
- return wynik + 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement