using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ExempleNotesPlusGrandes { class Program { static void Main(string[] args) {/* Chercher la meilleur note par étudiant puis par cours dans un tableau ŕ */ int ligne = 4, colonne = 5, posPlusgrande; float[,] notes ={ {90,70,80,85,100}, {95,75,85,70,90}, {100,50,70,80,60}, {80,70,60,70,40}}; float plusGrNote; //Chercher la plus grande note pour l'étudiant No1 plusGrNote = notes[0, 0]; posPlusgrande = 0; for (int j = 0; j < colonne; j++) { if (notes[0, j] > plusGrNote) { plusGrNote = notes[0, j]; posPlusgrande = j; } } Console.WriteLine("La plus grande note de l'étudiant No 1: {0} pour le cours No {1}", plusGrNote, posPlusgrande + 1); //Chercher la plus grande note pour l'étudiant No2 plusGrNote = notes[1, 0]; posPlusgrande = 0; for (int j = 0; j < colonne; j++) { if (notes[1, j] > plusGrNote) { plusGrNote = notes[1, j]; posPlusgrande = j; } } Console.WriteLine("La plus grande note de l'étudiant No 2: {0} pour le cours No {1}", plusGrNote, posPlusgrande + 1); //Chercher la plus grande note pour l'étudiant No3 plusGrNote = notes[2, 0]; posPlusgrande = 0; for (int j = 0; j < colonne; j++) { if (notes[2, j] > plusGrNote) { plusGrNote = notes[2, j]; posPlusgrande = j; } } Console.WriteLine("La plus grande note de l'étudiant No 3: {0} pour le cours No {1}", plusGrNote, posPlusgrande + 1); //Chercher la plus grande note pour l'étudiant No1 plusGrNote = notes[3, 0]; posPlusgrande = 0; for (int j = 0; j < colonne; j++) { if (notes[3, j] > plusGrNote) { plusGrNote = notes[3, j]; posPlusgrande = j; } } Console.WriteLine("La plus grande note de l'étudiant No 4: {0} pour le cours No {1}", plusGrNote, posPlusgrande + 1); Console.WriteLine(); Console.WriteLine(); for (int i = 0; i < ligne; i++) { plusGrNote = notes[i, 0]; posPlusgrande = 0; for (int j = 0; j < colonne; j++) { if (notes[i, j] > plusGrNote) { plusGrNote = notes[i, j]; posPlusgrande = j; } } Console.WriteLine("La plus grande note de l'étudiant No {0}: {1} pour le cours No {2}",i+1, plusGrNote, posPlusgrande + 1); } Console.WriteLine(); Console.WriteLine(); for (int j = 0; j < colonne; j++) { plusGrNote = notes[0, j]; posPlusgrande = 0; for (int i = 0; i < ligne; i++) { if (notes[i, j] > plusGrNote) { plusGrNote = notes[i, j]; posPlusgrande = i; } } Console.WriteLine("La plus grande note du cours {0}: {1} pour l'étudiant No {2}", j + 1, plusGrNote, posPlusgrande + 1); } Console.Read(); } } }