1 solutions

  • 0
    @ 2025-11-27 11:55:05

    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

    Information

    ID
    40
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By