Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,m,i,j,min,max;
- cout <<"Vnesi go m:"<<endl;
- cin>>m;
- cout <<"Vnesi go n:"<<endl;
- cin>>n;
- int mat[m][n];
- int pom[m];
- cout <<"Vnesi gi clenovite na matricata:"<<endl;
- for(i=0;i<m;i++)
- {
- for(j=0;j<n;j++)
- {
- cin>>mat[i][j];
- }
- }
- for(i=0;i<m;i++)
- {
- for(j=0;j<n;j++)
- {
- cout<<mat[i][j]<<" ";
- }
- cout<<endl;
- }
- for(i=0;i<m;i++)
- {
- max=mat[i][0];
- for(j=0;j<n;j++)
- {
- if(mat[i][j]>max)
- max=mat[i][j];
- }
- pom[i]=max;
- }
- min=pom[0];
- for(j=0;j<n;j++)
- {
- if(pom[j]<min)
- min=pom[j];
- }
- cout<<"Najmaliot od najgolemite po redici e: "<<min<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement