6 条题解

  • 2
    @ 2022-8-30 21:25:40
    s=input().split()
    a=int(ord(s[0])-64)
    for i in range(1,2*a,1):
        if i<=a:
            h=1
            while h<=(2*a-2*i+1)/2:
                    print(' ',end="")
                    h=h+1 
            h=1  
            while h<=2*i-1:
                print(chr(64+i),end='')
                h=h+1
        else:
            h=1
            while h<=i-a:
                    print(' ',end="")
                    h=h+1 
            h=1  
            while h<=(2*a-i)*2-1:
                print(chr(64+2*a-i),end='')
                h=h+1
        print('')
    
    • 1
      @ 2022-7-11 11:16:39

      将 #63. 【苏州NOI】d056: 菱形图案 稍作更改即可

      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int n,i,k,j;
      	char ch;
      	cin>>ch;
      	for(i=1;i<=((int)ch-'A'+1);i++)
      	{
      		k=0;
      		while(((int)ch-'A'+1)-i>k)
      		{
      			cout<<" ";
      			k++;
      		}
      		for(j=0;j<2*i-1;j++)
      		cout<<(char)('A'+i-1);
      		cout<<endl;
      	}
      	for(i-=2;i!=0;i--)
      	{
      		k=0;
      		while(((int)ch-'A'+1)-i>k)
      		{
      			cout<<" ";
      			k++;
      		}
      		for(j=0;j<2*i-1;j++)
      		cout<<(char)('A'+i-1);
      		cout<<endl;
      	}
      	
      }
      
      • 0
        @ 2023-7-18 15:12:23

        #include #include #include

        using namespace std;

        int main() { int x,t; string s1,s2,s3; cin>>s1; for(int j=0;j<s1.length();j++){ x=s1[j]-'A'+1; } for (int i=1;i<=x-1;i++){ for(int j=0;j<s1.length();j++){ t = 2*(i-1)+1; for (int m=x-i;m>0;m--){ cout<<" "; } for (int n=1;n<=t;n++){ s2 = s1[j]-(x-i); cout<<s2; } cout<<"\n"; } } for (int i=x;i>=0;i--){ for(int j=0;j<s1.length();j++){ t = 2*i-1; for (int m=i+1;m<=x;m++){ cout<<" "; } for (int n=1;n<=t;n++){ s3 = s1[j]-(x-i); cout<<s3; } cout<<"\n"; } } return 0; }

        • @ 2023-7-18 15:13:00

          昨天的改版,60多行。。。

      • 0
        @ 2022-7-19 19:48:24
        using namespace std;
        int main(){
        	int m=0,n,g=0;
        	char a,b;
        	cin>>a;
        	n=a;
        	for(int i=65;i<=90;i++){
        		m++;
        		for(int j=1;j<=(n-64)-m;j++){
        			cout<<" ";
        		}
        		for(int k=1;k<=2*(i-64)-1;k++){
        			b=i;
        			cout<<b;
        		}
        		if(i==n){
        			break;
        		}
        		cout<<endl;
        	}
        	cout<<endl;
        	for(int d=n-1;d>=65;d--){
        		g++;
        		for(int f=1;f<=g;f++){
        			cout<<" ";
        		}
        		for(int e=1;e<=2*(d-64)-1;e++){
        			b=d;
        			cout<<b;
        		}
        		cout<<endl;
        	}
        		
        	
        	return 0;
        }
        
        • 0
          @ 2022-7-11 8:24:08
          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
          	char a;
          	cin>>a;
          	int b=a;
          	int sum=2*b-129;
          	if(b>=65&&b<=90)
          	{
          		for(int i=65;i<=b;i++)
          		{
          			for(int j=b-i;j>=1;j--)
          			{
          				cout<<" ";
          			}
          			for(int k=1;k<=2*i-129;k++)
          			{
                          char x=i;
                          cout<<x;
          			}
          			cout<<endl;
          		}
          		int o,p,q,s;
          		int ans=3*b-129; 
                  for(o=b-1;o>=65;o--)
          	    {
          		   for(p=1;p<=b-o;p++)
          		   {
          			  cout<<" ";
          	       }
          		   for(q=1;q<=ans-o-3;q++)
          		   {
          			  char m=o;
                        cout<<m;
          		   }
          		   cout<<endl;
          		   ans=ans-3;
          	    } 
          	} 
              return 0;
          }
          
          • -1
            @ 2023-7-18 7:27:09

            #include <bits/stdc++.h> using namespace std; int main() { char c1; cin>>c1; int n=c1-'A'+1; for(int i=1; i<=n; i++){ char c2='A'+i-1; for (int j=1;j<=n-i;j++){

                    cout<<" ";
                }
                for(int j=1; j<=2*i-1; j++){
                    cout<<c2;
                }cout<<endl;
            }
            for(int i=1; i<=n-1; i++){
                char c3=c1-i;
                for (int j=1;j<=i;j++){
            
                    cout<<" ";
                }
                for(int j=1; j<=2*n-2*i-1; j++){
                    cout<<c3;
                }cout<<endl;
            }
            
            
            
            
            
            return 0;
            

            }

            • 1

            信息

            ID
            76
            时间
            1000ms
            内存
            128MiB
            难度
            4
            标签
            递交数
            428
            已通过
            211
            上传者