文章

19

粉丝

0

获赞

2

访问

4.0k

头像
字符棱形 题解:
P1473 杭州电子科技大学2019年机试题
发布于2024年3月7日 16:13
阅读数 224

#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    for (int row = 1; row <= n; row++) {
        for (int col = 1; col <= n - row; col++) {
            cout << " ";
        }
        for (int num = 0; num < 2 * row - 1; num++) {
            cout << "*";
        }
        cout << endl;
    }
    for (int row = n-1; row >= 1; row--) {
        for (int col = 1; col <= n - row; col++) {
            cout << " ";
        }
    &...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发