Untitled

 avatar
unknown
c_cpp
4 years ago
444 B
5
Indexable
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
    int n, 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];
        }
    }
    
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < m; j++) {
            if(i + j == n - 1) {
                cout << mat[i][j] << endl;
            }
        }
    }
    return 0;
}

Editor is loading...