Advertisement
SergeyPGUTI

8.2.4

Feb 18th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <string.h>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int n,m,Max=0,iMax=0,jMax=0;
  11.     cin>>n;
  12.     cin>>m;
  13.     int ** p= new int*[n];
  14.  
  15.     for (int i=0;i<n;i++)
  16.     {
  17.         p[i]=new int[m];
  18.     }
  19.  
  20.     for(int i=0;i<n;i++)
  21.     {
  22.         for(int j=0;j<m;j++)
  23.             cin>>p[i][j];
  24.     }
  25.  
  26.     for (int i=0;i<n;i++)
  27.     {
  28.  
  29.         for(int j=0;j<m;j++)
  30.             {
  31.                 if (p[i][j]>Max) {
  32.                 Max=p[i][j];
  33.                 iMax=i;
  34.                 jMax=j;
  35.                 }
  36.             }
  37.  
  38.     }
  39.        cout<<Max<<endl;
  40.        cout<<iMax<<" "<<jMax;
  41.  
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement