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