1 条题解

  • 0
    @ 2025-8-27 19:51:07

    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
    5339
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者