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;
- float total=0;
- for(int iLig = 0; iLig <3 ; iLig ++)
- {
- for(int iCol = 0; iCol <4 ; iCol ++, compteur++)
- {
- total = total + monTab2D[iLig,iCol];
- }
- }
- float somme = total / compteur;
- Console.WriteLine("La moyenne des notes du tableau est {0}",somme);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement