6 条题解

  • 4
    @ 2022-12-10 18:31:31
    #include <iostream>
    using namespace std;
    int main()
    {
    	int i, j, n;
    	char c;
    	cin >> n;
    	for (i = 1; i <= n; i = i + 1)
        {
    		for (j = 1; j <= n - i; j += 1)
            {
    			cout << " ";
    		}
    		for (j = 1; j <= 2 * i - 1; j += 1)
            {
    			c = j + 64;
    			cout << c;
    		}
    		cout << endl;
    	}
        return 0;
    }//代码已AC
    
    • 2
      @ 2023-8-9 23:17:11

      也就把上题的代码改一下而已

      #include <bits/stdc++.h>
      using namespace std;
      int n;
      int main()
      {
          cin>>n;
          for(int i=1;i<=n;i++)
          {
              for(int j=1;j<=n-i;j++)
                  cout<<" ";
              for(int j=1;j<=i*2-1;j++)
                  cout<<char('A'+j-1);
              cout<<endl;
          }
          return 0;
      }
      
      • 1
        @ 2024-4-15 20:04:50
        #include<iostream>
        using namespace std;
        int n;
        char a[27]={' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};//打表
        int main(){
            cin>>n;
            for(int i=1;i<=n;i++){
                for(int j=1;j<=n-i;j++)//输出空格
                    cout<<" ";
                for(int j=1;j<=2*i-1;j++)//输出字母
                    cout<<a[j];
                cout<<endl;//换行
            }
            return 0;
        }//编者:Royal
        
        • -1
          @ 2024-3-19 20:20:24

          一手交货,一手交赞,别忘了!!!!!!!!!!!!!!

          #include
          using namespace std;
          int n;
          int main()
          {
              cin>>n;
              for(int i=1;i<=n;i++)
              {
                  for(int j=1;j<=n-i;j++)
                      cout<<" ";
                  for(int j=1;j<=i*2-1;j++)
                      cout<<char('A'+j-1);
                  cout<<endl;
              }
              return 0;
          }
          
          • -1
            @ 2024-2-19 13:46:12
            #include <bits/stdc++.h>
            using namespace std;
            int main()
            {
                int n, x;
                cin >> n;
                char y;
                x = n - 1;
                for (int i = 1; i <= n; i++)
                {
                    y = 65;
                    for (int j = 1; j <= x; j++)
                    {
                        cout << " ";
                    }
                    for (int j = 1; j <= i * 2 - 1; j++)
                    {
                        cout << y;
                        y++;
                    }
                    x--;
                    cout << endl;
                }
                return 0;
            }
            
            • -1
              @ 2023-7-8 7:54:40

              #include <iostream> 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 << " "; } for (int j = 1; j <= 2*i-1; j++) { cout << (char)(j+64); } cout << endl; } return 0; }

              • 1

              【入门】字符图形11-字母正三角

              信息

              ID
              96
              时间
              1000ms
              内存
              16MiB
              难度
              3
              标签
              递交数
              182
              已通过
              92
              上传者