很简单的一道题目,分为两层,一层是横着放置,另外一层是竖着放置即可满足题目条件,具体实现见如下代码:
#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<deque>
#include<functional>
using namespace std;
int n;
char getId(int ind){
if (ind < 26) return 'A' + ind;
return 'a' + ind - 26;
}
int main(){
while (cin >> n){
cout << "2 " << n << " " << n << endl;
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
cout << getId(i);
}
cout << '\n';
}
cout << '\n';
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
cout << getId(j);
}
cout << '\n';
}
}
}