4 solutions

  • 0
    @ 2026-8-20 20:29:16
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		for(int a=1;a<=n-i;a++)
    		{
    			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;
    }
    
    • 0
      @ 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;
      }
      
      • -2
        @ 2025-6-7 10:21:34

        #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; }

        • -8
          @ 2024-11-30 11:45:53

          fdidfgfnb vfddfbmsfkfnjb dfl vkdasnk fmbvjlksdbjvkbnsdfgfjheauahgbvuaefghbauuhdfjbgufuhidsrehtbjyeuisebbewjh2weuurdvjsgrbrhewyusdiyfd

          • 1

          Information

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