Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n, m;
- int najgolem;
- int oke=1;
- cin >> n >> m;
- int matrica[n][m];
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) {
- cin >> matrica[i][j];
- }
- }
- for(int i=0;i<n-1;i++) {
- najgolem=matrica[i][0];
- for(int j=0;j<m;j++) {
- if(matrica[i][j]>najgolem) {
- najgolem=matrica[i][j];
- }
- }
- for(int j=0;j<m;j++) {
- if(najgolem<=matrica[i+1][j]) {
- oke=0;
- cout<<i<<endl;
- }
- }
- }
- if(oke==1) {
- cout<<"DA"<<endl;
- }
- else {
- cout<<"ne"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement