よじろめ覚書

私の理解度重視のソースコードです。

ABC062B - Picture Frame

問題:B - Picture Frame

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

#define REP(i, n) for (int i = 0; i < (n); ++i)

int main(void) {
    int h, w;
    string a[100], line = "";

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> h >> w;
    REP(i, h) {
        cin >> a[i];
    }
    REP(i, w + 2) {
        line += "#";
    }

    cout << line << "\n";
    REP(i, h) {
        cout << "#" << a[i] << "#" << "\n";
    }
    cout << line << "\n";
    return 0;
}