全部评论 3

  • #include <iostream>

    using namespace std;
    int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n / 2; i++) {
    for (int j = 0; j < i; j++) {
    cout << " ";
    }
    for (int x = 0; x < n - 2 * i; x++) {
    cout << "";
    }
    cout << endl;
    }
    for (int i = n / 2; i >= 0; i--) {
    for (int j = i; j > 0; j--) {
    cout << " ";
    }
    for (int x = n - 2 * i; x > 0; x--) {
    cout << "
    ";
    }
    cout << endl;
    }
    return 0;
    }

    2天前 来自 山东

    0
  • ``cpp
    #include <iostream>

    using stdcin;
    using std
    cout;
    using std::endl;
    int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n / 2; i++) {
    for (int j = 0; j < i; j++) {
    cout << " ";
    }
    for (int x = 0; x < n - 2 * i; x++) {
    cout << "";
    }
    cout << endl;
    }
    for (int i = n / 2; i >= 0; i--) {
    for (int j = i; j > 0; j--) {
    cout << " ";
    }
    for (int x = n - 2 * i; x > 0; x--) {
    cout << "
    ";
    }
    cout << endl;
    }
    return 0;
    }

    2天前 来自 山东

    0
  • #include <iostream>

    using stdcin;
    using std
    cout;
    using std::endl;
    int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n / 2; i++) {
    for (int j = 0; j < i; j++) {
    cout << " ";
    }
    for (int x = 0; x < n - 2 * i; x++) {
    cout << "";
    }
    cout << endl;
    }
    for (int i = n / 2; i >= 0; i--) {
    for (int j = i; j > 0; j--) {
    cout << " ";
    }
    for (int x = n - 2 * i; x > 0; x--) {
    cout << "
    ";
    }
    cout << endl;
    }
    return 0;
    }

    2天前 来自 山东

    0
暂无数据

提交答案之后,这里将显示提交结果~

首页