#include <stdio.h> #include <math.h> static double maximum( double matrice[][] ) { double max = matrice[0][0]; int nligne=matrice.length; for ( int r = 0; r < nligne; ++r ) for ( int c = 0; c < matrice[r].length; ++c ) if ( max < matrice[r][c] ) max = matrice[r][c]; return max; } int main() { double matrice[][]={ {12.5, 0.5, 3.0}, {-42.5, 15, 10.0, 85}, {20, 3, 3.0, 6.0} }; printf ("Valeur Maximale du tableau 2D= %d ", maximum(matrice)); } |
----------------------------------------------------------------------------