voltage

1228_main.c

Apr 29th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char** argv)
  4. {
  5.     int i, j;
  6.     float s, m[3][4] = {
  7.         { 5, -2, 3, -8},
  8.         { 12, 3, -4, 0 },
  9.         { 1, 2, 3, 4 }
  10.     };
  11.  
  12.     s = m[0][0];
  13.  
  14.     for(i = 0; i < 3; ++i)
  15.     {
  16.         for(j = 0; j < 4; ++j)
  17.         {
  18.             if(m[i][j] > s)
  19.             {
  20.                 s = m[i][j];
  21.             }
  22.         }
  23.     }
  24.  
  25.     printf("%f\n", s);
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment