Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: chokun
Problemset: อโมกุส
Language: cpp
Time: 0.005 second
Submitted On: 2026-10-07 20:49:25
#include <bits/stdc++.h>
using namespace std;
int main() {
// ปิดการ sync เพื่อให้รับส่งข้อมูลได้รวดเร็วขึ้น
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
// นิยามรูปแบบฐาน (Base Pattern) ของอโมกุสขนาด N = 1
vector<string> pattern = {
" ###",
"##",
"####",
" # #"
};
// ลูปผ่านแต่ละแถวของรูปแบบฐาน
for (const string& row : pattern) {
// ขยายในแนวตั้ง: พิมพ์ซ้ำแถวเดิมจำนวน N ครั้ง
for (int i = 0; i < n; ++i) {
// ลูปผ่านตัวอักษรแต่ละตัวในแถว
for (char c : row) {
// ขยายในแนวนอน: พิมพ์ตัวอักษรนั้นซ้ำจำนวน N ครั้ง
for (int j = 0; j < n; ++j) {
cout << c;
}
}
cout << "\n"; // จบแถวแล้วขึ้นบรรทัดใหม่
}
}
return 0;
}