5 solutions

  • 2
    @ 2025-11-27 17:16:52

    • 2
      @ 2025-11-27 17:15:54

      • 2
        @ 2025-11-27 17:12:42

        • -2
          @ 2025-11-22 15:41:04

          解题报告

          撰写人: ༺༺劳༒大༻༻

          题意分析

          输出矩形的下三角是指第 1 行的前 1 个数,第 2 行的前两个数,第 n 行的前 n 个数。

          难度等级

          ★★★☆☆

          解题思路

          用两层嵌套循环输出,其中(j<=i)。

          解题反思

          n≤100,数组范围要>100。

          参考程序

          #include<bits/stdc++.h>
          using namespace std;
          
          int n,a[105][105];
          
          int main(){
              
              scanf("%d",&n);
              for(int i=1;i<=n;++i){
                  for(int j=1;j<=n;++j){
                      scanf("%d",&a[i][j]);
                  }
              }
              for(int i=1;i<=n;++i){
                  for(int j=1;j<=i;++j){
                      printf("%d ",a[i][j]);
                  }
                  printf("\n");
              }
              
              return 0;
          }
          
        • -7
          @ 2025-11-18 17:29:39

          解题报告

          撰写人: 许苡键

          难度等级

          ★☆☆☆☆

          参考程序

          #include<bits/stdc++.h>
          using namespace std;
          int n,m,a[1000][1000];
          int main(){
          	cin>>n;
          	for(int i=1;i<=n;i++){
          		for(int j=1;j<=n;j++)
          			cin>>a[i][j];
          	}
          	for(int i=1;i<=n;i++){
          		for(int j=1;j<=i;j++){
          			cout<<a[i][j]<<' ';
          		}
          		cout<<endl;
          	}
          }
          
        • 1

        Information

        ID
        294
        Time
        1000ms
        Memory
        64MiB
        Difficulty
        1
        Tags
        # Submissions
        36
        Accepted
        28
        Uploaded By