Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void printMap(char map[][100], int maxRow, int maxCol) {
- for (int i = 0; i < maxRow; i++) {
- for (int j = 0; j < maxCol; j++) {
- if (map[i][j] == NULL) break;
- cout << map[i][j];
- // cout << i << ", " << j << ": " << map[i][j] << endl;
- }
- cout << endl;
- }
- }
- int main() {
- int m, n;
- do {
- cin >> m >> n;
- char map[m][n] = { NULL };
- for (int i = 0; i < m; i++) {
- for (int j = 0; j < n; j++) {
- cin >> map[m][n];
- }
- }
- printMap(map, m, n);
- } while (m != 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement