You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
474 B

#include <bits/stdc++.h>
using namespace std;
int main() {
int m, n, a[100][100] = {0};
cin >> m >> n;
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
cin >> a[i][j];
}
}
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
if (a[i][j] > 0) {
cout << i + 1 << " " << j + 1 << " " << a[i][j] << endl;
}
}
}
return 0;
}