2 条题解

  • 3
    @ 2022-12-12 10:02:59
    #include <iostream>
    using namespace std;
    int main()
    {
    	int n;
    	cin >> n;
    	n = n / 2 + 1;
    	for (int i = n; i >= 1; i--)
        {
    		for (int j = 1; j <= i; j++)
            {
    			cout << "*";
    		}
    		cout << endl;
    	}
    	for (int i = 2; i <= n; i++)
        {
    		for (int j = 1; j <= i; j++)
            {
    			cout << "*";
    		}
    		cout << endl;
    	} 
    	return 0;
    }
    
    • 1
      @ 2023-9-2 22:08:07
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a;
          cin >> a;
          for (int i = a / 2 + 1;i >= 1;i--)
          {
              for (int j = 1;j <= i;j++)
              {
                  cout << "*";
              }
              cout << endl;
          }
          for (int i = 2;i <= a / 2 + 1;i++)
          {
              for (int j = 1;j <= i;j++)
              {
                  cout << "*";
              }
              cout << endl;
          }
      }//AC
      
      • 1

      信息

      ID
      230
      时间
      1000ms
      内存
      16MiB
      难度
      1
      标签
      递交数
      72
      已通过
      53
      上传者