2 条题解

  • 0
    @ 2024-12-25 13:15:33

    #include<bits/stdc++.h> using namespace std; int a[1000000]; int b[101][101]; int main() { int n,*p1; cin>>n; for(int i=1;i<=n;i++) { p1=&i; for(int j=1;j<=n;j++) { if(j==*p1) { } cout<<n+1-max(i,j)<<" "; } cout<<endl; } return 0; }

    • 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;
      }
      
      • 1

      信息

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