2 条题解

  • 1
    @ 2023-5-3 15:42:51
    #include <iostream>
    using namespace std;
    int main()
    {
        int n;
        cin >> n;
        int a[n + 1][n + 1];
        for (int i = 1; i <= n; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                a[i][j] = min(i, j);
            }
        }
        for (int i = n; i >= 1; i--)
        {
            for (int j = n; j >= 1; j--)
            {
                cout << "  " << a[i][j];
            }
            cout << endl;
        }
        return 0;
    }
    
    • 0
      @ 2022-10-27 21:24:45
      #include<iostream>
      #include<iomanip>
      using namespace std;
      
      int main(){
      	int n;
      	cin >> n;
      	for(int i = 1;i <= n;i++){
      		for(int j = 1;j <= n;j++){
      			cout << setw(3) << n + 1 - max(i,j);
      		}
      		cout << "\n";
      	}
      }
      

      简单!

      • 1

      信息

      ID
      197
      时间
      1000ms
      内存
      16MiB
      难度
      1
      标签
      递交数
      55
      已通过
      47
      上传者