// 숫자 문자 1개 → - '0' 하면 정수 변환 가능
// '0'  '1'  '2'  '3'  '4'
// 48   49   50   51   52


// '1' - '0' = 49 - 48 = 1
// '5' - '0' = 53 - 48 = 5
// 입력
// 3
// 1 2 3
// 4 5 6
// 7 8 9
#include <iostream>
using namespace std;

int main() {
    int N;
    cin >> N;

    int arr[100][100];

    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            cin >> arr[i][j];
        }
    }

    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            cout << arr[i][j] << " ";
        }
        cout << "\n";
    }
}

// 입력   
// 3
// 101
// 010
// 111

#include <iostream>
#include <string>
using namespace std;

int main() {
    int N;
    cin >> N;

    int arr[100][100];

    for(int i = 0; i < N; i++) {
        string s;
        cin >> s;

        for(int j = 0; j < N; j++) {
            arr[i][j] = s[j] - '0';
        }
    }

    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            cout << arr[i][j] << " ";
        }
        cout << "\n";
    }
}
// 📌 문제: 좌표 출력

// 배열에서 값이 1인 좌표를 모두 출력하시오.

// 출력 예시
// (0,0)
// (0,2)
// (1,1)
// (2,0)
// (2,1)
// (2,2)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: