Advertisement
parallelogram

Untitled

Dec 27th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int i,j,m,n,a[10][10];
  7.  
  8.     scanf("%d",&n);
  9.     scanf("%d",&m);
  10.  
  11.     for(j=0;j<m;j++)
  12.     {
  13.         for(i=0;i<n;i++)
  14.         {
  15.             scanf("%d",&a[i][j]);
  16.         }
  17.     }
  18.  
  19.  
  20.     for(j=0;j<m;j++)
  21.     {
  22.         for(i=0;i<n;i++)
  23.         {
  24.             printf("%d ",a[i][j]);
  25.         }
  26.         printf("\n");
  27.     }
  28.  
  29.  
  30.  
  31.     int max;
  32.  
  33.     max=0;
  34.     for(j=0;j<m;j++)
  35.     {
  36.         for(i=0;i<n;i++)
  37.         {
  38.           if(a[i][j]>max)
  39.           {
  40.               max=a[i][j];
  41.           }
  42.         }
  43.         printf("%d ",max);
  44.     }
  45.  
  46.  
  47.  
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement