2 solutions

  • 2
    @ 2025-7-15 14:42:28
    #include<bits/stdc++.h>
    using namespace std;
    
    signed main() {
        int n, x = 1;
        cin >> n;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n - i; j++) {
                if (x < 10) cout << 0 << x;
                else cout << x;
                x++;
            }
            cout << '\n';
        }
        return 0;
    }
    
    • 1
      @ 2025-7-15 15:33:57
      ```cpp
      #include<bits/stdc++.h>
      #include <cstdio>
      using namespace std;
      int main(){
          int n,k=1;
          cin >> n;
          for(int i = 0;i <= n;i++){
              for(int j = 1;j<=n-i;j++){
                  printf("%02d",k++);
              }
              cout << endl;
          }
          return 0;
      
      
      }      
      
      
      
      • 1

      Information

      ID
      9743
      Time
      1000ms
      Memory
      125MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      37
      Accepted
      25
      Uploaded By