daily pastebin goal
15%
SHARE
TWEET

max

a guest Dec 10th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void citeste(int a[][50],int&m, int&n)
  6. {cout<<"m= "; cin>>m; cout<<"n= "; cin>>n;
  7. for(int i=0;i<m;i++)
  8.     for(int j=0;j<n;j++){
  9. cout<<"a["<<i+1<<","<<j+1<<"]= "; cin>>a[i][j];}}
  10. void maxim(int a[][50],int m, int n, int &maxx,int &n1,int &nc)
  11. {maxx=a[0][0];n1=0;nc=0;
  12. for(int i=0;i<m;i++)
  13.     for(int j=0;j<n;j++)
  14.     if(a[i][j]>maxx) {maxx=a[i][j]; n1=i;nc=j;}}
  15.  
  16. int main()
  17. {int a[50][50],m,n,maxx,n1,nc; citeste(a,m,n);
  18. maxim(a,m,n,maxx,n1,nc);
  19. cout<<"Maximul este  >"<< maxx <<" si apare prima data "<<endl;
  20.     cout<<"In linia  > "<< n1+1 <<" si coloana > "<<nc+1<<endl;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top