休闲时间:小小的视觉盛宴
上代码:#include bits\stdc.h #include windows.h using namespace std; char a[10005][10005]; int n; void b(int x,int y,int deep){ if(deep 1){ a[x][y] /; a[x][y 1] \\; a[x 1][y - 1] /; a[x 1][y] _; a[x 1][y 1] _; a[x 1][y 2] \\; return; } b(x, y, deep - 1); b(x pow(2, deep - 1), y - pow(2, deep - 1), deep - 1); b(x pow(2, deep - 1), y pow(2, deep - 1), deep - 1); } int main(){ th: cin n; if (n 0)return 0; for(int i 1; i (1 n); i) for(int j 1; j (1 n 1); j) a[i][j] ; b(1, (1 n), n); for(int i 1; i (1 n); i){ for(int j 1; j (1 n 1); j) cout a[i][j]; cout endl; } Sleep(3000); system(cls); goto th; }Warning: 请务必粘贴, 并且要有足够大的输出空间(屏幕), 方可享受视觉盛宴. 建议 n 输入: 1 ~ 10, 8, 9, 10 可达到极致效果~题目灵感见https://www.luogu.com.cn/problem/P1498又水了一期, 哈哈哈