Untitled
unknown
plain_text
2 months ago
1.1 kB
3
Indexable
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]){ int matrica[5][5]={{1,3,2,4,6}, {2,9,7,8,5}, {5,2,3,7,4}, {7,3,8,6,9}, {8,6,9,9,7}}; int nr; cout<<"Vendosni nje numer me te vogel se 6 : "; cin>>nr; int min = matrica[nr][0], max=0; for(int i = 0 ; i < 5 ; i++){ for(int j = 0 ; j < 5 ; j++){ if(i == (nr - 1)){ if(min > matrica[i][j]) { min = matrica[i][j]; } } if(j == (nr-1)){ if(max < matrica[i][j]) max = matrica[i][j]; } } } cout<<"\nminimumi per rreshtin qe vendoset eshte "<<min<<endl; cout<<"\nmaximumi per shtyllen eshte "<<max<<endl; system("PAUSE"); return EXIT_SUCCESS; }
Editor is loading...
Leave a Comment