#include using namespace std; string str; stringstream ss; int main() { int n; cin >> n; int x = 2 * n - 1; for (int i = 1; i <= 1500; i++) { //先产生1到1500的字符串 string str1; ss << i; ss >> str1; str += str1; ss.clear(); } int length = 4 * n - 4; //等腰三角形周长 for (int i = 1; i <= n; i++) { //一共n行 if (i != n && i != 1) { //除了这两行其余每行都只有两个数 for (int j = 1; j <= n + i - 1; j++) { if (j == n - i + 1) { //每一行左边的那个数 cout << str[i - 1]; } else if (j == 2 * n - (n - i + 1)) { //左右下标之和为2*n cout << str[4 * n - 4 - (i - 1)] << endl; //每一行右边的数 ,每一行左边和右边的数应该输出的序号之和为4*n-4 } else { cout << '.'; } } } else if (i == 1) { for (int x = 1; x <= n; x++) { //处理最后一行,最后一行有2*n-1个字符 if (x == n) { cout << '1' << endl; } else { cout << '.'; } } } else { for (int m = 1; m <= 2 * n - 1; m++) { //处理最后一行,最后一行有2*n-1个字符,从str[n-1]到str[3*n-1] cout << str[n + (m - 2)]; } } } return 0; }