2 solutions

  • -2
    @ 2024-7-11 15:30:59
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		for(int j=1;j<=n-i;j++)
    		{
    			cout<<" ";
    		}
    		char ch='A'+i-1;
    		for(char c=ch;c>='A';c--)
    		{
    			cout<<c;
    		}
    		for(char c='B';c<=ch;c++)
    		{
    			cout<<c;
    		}
    		cout<<endl;
    	}
    	return 0;
    }
    

    Information

    ID
    65
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    97
    Accepted
    41
    Uploaded By