Building for UN UVA - 1605

版权声明:欢迎转载!拒绝抄袭. https://blog.csdn.net/qq_36257146/article/details/89819449

这道题真是神了。我真是没有想到可以这么写。

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    int H = 2;
    char t;
    while(cin>>n)
    {
        cout<<H<<" "<<n<<" "<<n<<endl;

        for(int i =0;i<n;i++)
        {
            for(int j = 0;j<n;j++){
                if(i>25) t = i-26+'a';
                else t = i+'A';
                printf("%c",t);
            }
            cout<<endl;
        }
        cout<<endl;
        for(int i =0;i<n;i++)
        {
            for(int j = 0;j<n;j++){
                if(j>25) t = j-26+'a';
                else t = j+'A';
                printf("%c",t);
            }
            cout<<endl;
        }
    }





    return 0;
}
/**
4
**/

猜你喜欢

转载自blog.csdn.net/qq_36257146/article/details/89819449
un