学长的正解
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
cin.tie(0) -> sync_with_stdio(0);
string a[12] = {"..GGG.....IIIII.......A.........OOO..",
".G...G......I.........A........O...O.",
"G.....G.....I........A.A......O.....O",
"G.....G.....I........A.A......O.....O",
"G...........I.......A...A.....O.....O",
"G...........I.......A...A.....O.....O",
"G...........I.......A...A.....O.....O",
"G...GGG.....I......AAAAAAA....O.....O",
"G....G......I......A.....A....O.....O",
".G...G......I......A.....A....O.....O",
".G...G......I......A.....A.....O...O.",
"..GGG.....IIIII...AAA...AAA.....OOO.."};
int n;
cin >> n;
for (int i = 0; i < 12; i ++) {
for (int j = 0; j < n; j ++) {
for (auto ch : a[i]) {
for (int k = 0; k < n; k ++) {
cout << ch;
}
}
cout << "\n";
}
}
}
我的笨比400行
#include <iostream>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <queue>
#include <bitset>
#include <vector>
#include <map>
#include <unordered_map>
//#define int long long
#define endl '\n'
#define lowbit(x) (x) & (-x)
#define mh(x) memset(x, -1, sizeof h)
#define debug(x) cerr << #x << "=" << x << endl;
#define brk exit(0);
using namespace std;
void TLE() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); }
const int N = 2e5 + 10;
const int M = 2 * N;
const int mod = 998244353;
const double esp = 1e-6;
const double pi = acos(-1);
typedef pair<int, int> PII;
typedef long long ll;
signed main()
{
int n;
cin >> n;
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "..";
for (int i = 1; i <= n; i++)
cout << "GGG";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "IIIII";
for (int i = 1; i <= n; i++)
cout << ".......";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".........";
for (int i = 1; i <= n; i++)
cout << "OOO";
for (int i = 1; i <= n; i++)
cout << "..";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << ".";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << ".........";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << "........";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << "........";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << "........";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "...........";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << ".......";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "...........";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << ".......";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "...........";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << ".......";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "GGG";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "AAAAAAA";
for (int i = 1; i <= n; i++)
cout << "....";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "....";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << "....";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << ".";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << "....";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
cout << endl;
}
for (int j = 1; j <= n;j++)
{
for (int i = 1; i <= n; i++)
cout << ".";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "G";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "I";
for (int i = 1; i <= n; i++)
cout << "......";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "A";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "O";
for (int i = 1; i <= n; i++)
cout << ".";
cout << endl;
}
for (int j = 1; j <= n; j++)
{
for (int i = 1; i <= n; i++)
cout << "..";
for (int i = 1; i <= n; i++)
cout << "GGG";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "IIIII";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "AAA";
for (int i = 1; i <= n; i++)
cout << "...";
for (int i = 1; i <= n; i++)
cout << "AAA";
for (int i = 1; i <= n; i++)
cout << ".....";
for (int i = 1; i <= n; i++)
cout << "OOO";
for (int i = 1; i <= n; i++)
cout << "..";
cout << endl;
}
return 0;
}