明明是和答案一模一样啊,怎么全部WA了呢?
查看原帖
明明是和答案一模一样啊,怎么全部WA了呢?
921616
mammal7楼主2024/5/3 23:50
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    for(int i = 1 , t = 1 ; i <= n ; i ++)
    {
        for(int j = 1 ; j <= n ; j ++ , t ++ )
            printf("%.2d" , t);
        cout << endl;
    }

    cout << endl;
    for(int i = 1 , t = 1 ; i <= n ; i ++ )
    {
        int x = (n - i) * 2;
        for(int k = 0 ; k < x ; k ++ )
            cout << " ";
        for(int j = 1 ; j <= i ; j ++ , t ++)
        {
            if(t < 10)
                cout << 0;
            cout << t;
        }
        cout << endl;
    }
    return 0;
}


2024/5/3 23:50
加载中...