1 条题解

  • 0
    @ 2025-12-31 13:54:56

    C++ :

    #include <iostream>
    using namespace std;
    int main() {
    int n = 0;
    cin >> n;
     for (int i = 0; i < n; i++) {
     for (int j = 0; j < n; j++) {
     if (i == j || i + j == n - 1) {
     cout << "+";
     } else {
     cout << "-";
     }
     }
     cout << endl;
     }
    return 0;
    }
    
    • 1

    信息

    ID
    170
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    递交数
    2
    已通过
    2
    上传者