Anton123

Untitled

Jan 1st, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.08 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. void main()
  4. {
  5.       int i,j,n=10,m=12;
  6.       float a[10][12],maxstr[10],maxstol[12],max;
  7.       printf(" Matrica a:\n");
  8.        for(i=0;i<n;i++)
  9.        {   printf("\n");
  10.            for(j=0;j<m;j++)
  11.            {
  12.             a[i][j]=0.005*rand();
  13.             printf("%6.1f",a[i][j]);
  14.            }
  15.        }
  16.  
  17.         printf("\n");
  18.         for(i=0;i<n;i++)
  19.          {
  20.             maxstr[i]=-1000;
  21.                for(j=0;j<m;j++)
  22.             if(a[i][j]>maxstr[i]) maxstr[i]=a[i][j];
  23.  
  24.          }
  25.          printf("\nMaximalnoe znachenye stroky: %6.1f",maxstr[i]);
  26.  
  27.          for(j=0;j<m;j++)
  28.          {
  29.             maxstol[j]=-1000;
  30.                for(i=0;i<n;i++)
  31.  
  32.             if(a[i][j]>maxstol[j]) maxstol[j]=a[i][j];
  33.  
  34.          }
  35.          printf("\nMaximalnoe znachenye stolbca: %6.1f",maxstol[j]);
  36.  
  37.          max=a[0][0];
  38.               for(i=0;i<n;i++)
  39.                  for(j=0;j<m;j++)
  40.          {
  41.               if(a[i][j]>max) max=a[i][j];
  42.  
  43.          }
  44.          printf("\nMaximalnoe znachenye matricy a: %6.1f",max);
  45.  
  46.  
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment