Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace o
- {
- class Program
- {
- public static void Main(string[] args)
- {
- int[,] monTab2D = { { 1, 3, 5, 7 }, { 2, 4, 6, 8 }, { 3, 6, 9, 12 } };
- int compteur = 0;
- int nombremin = monTab2D[2,3];
- int indicex = 0;
- int indicey = 0;
- for(int iLig = 0; iLig <3 ; iLig ++)
- {
- for(int iCol = 0; iCol <4 ; iCol ++, compteur++)
- {
- if (nombremin > monTab2D[iLig,iCol])
- {
- nombremin = monTab2D[iLig,iCol];
- indicex = iLig;
- indicey = iCol;
- }
- }
- }
- Console.WriteLine("Le plus petit des nombres du tableau est {0}",nombremin);
- Console.WriteLine("Indice {0} {1}",indicex,indicey);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement