2 条题解

  • 0
    @ 2024-4-2 13:56:26
    #include<iostream>
    using namespace std;
    int main()
    {
    	int n;
    	int a[10][10];
    	cin >> n;
    	for (int i = 1; i <= n; i++)
    	{
    		for (int j = 1; j <= n; j++)
    		{
    			if (j <= i)
    			{
    				a[i][j] = n + 1 - i;
    				cout <<a[i][j]<<" " ;
    			}
    			else
    			{
    				a[i][j] = n + 1 - j;
    				cout <<a[i][j]<<" " ;
    			}
    		}
    		cout << endl;
    	}
    	return 0;
    }
    

    信息

    ID
    144
    时间
    1000ms
    内存
    256MiB
    难度
    8
    标签
    递交数
    35
    已通过
    7
    上传者