Guest User

Untitled

a guest
Sep 19th, 2019
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {float a[20][30];
  7. int i,j,m,n,k,maxim;
  8. cout<<"Nr de linii="; cin>>m;
  9. cout<<"Nr de coloane="; cin>>n;
  10. for(i=1;i<=m;i++)
  11. for(j=1;j<=n;j++)
  12. {cout<<"a["<<i<<"]["<<j<<"]=";
  13. cin>>a[i][j];}
  14. for(i=1;i<=m;i++)
  15. {for(j=1;j<=n;j++)
  16. cout<<a[i][j]<<" ";
  17. cout<<endl;}
  18. cout<<"K="; cin>>k;
  19. maxim=a[k][1];
  20. for(j=1;j<=n;j++)
  21. if(a[k][j]<a[k][j+1])
  22. maxim=a[k][j+1];
  23. cout<<"Nr maxim din coloana "<<k<<" este "<<maxim;
  24.  
  25.  
  26. return 0;
  27. }
RAW Paste Data