1 条题解

  • 1
    @ 2023-11-26 21:20:02
    #include <bits/stdc++.h>
    using namespace std;
    
    int main() {
    	int n;
    	cin >> n;
    	for (int i = n; i > 0; i--) {
    		for (int j = 0; j < i; j++) {
    			cout << " ";
    		}
    		for (int j = 0; j <= 2 * (n - i); j++) {
    			cout << "*";
    		}
    		cout << endl;
    	}
    	for (int i = 0; i <= n; i++) {
    		for (int j = 0; j < i; j++) {
    			cout << " ";
    		}
    		for (int j = 0; j <= 2 * (n - i); j++) {
    			cout << "*";
    		}
    		cout << endl;
    	}
    	return 0;
    }
    
    

    信息

    ID
    72
    时间
    1000ms
    内存
    16MiB
    难度
    2
    标签
    递交数
    58
    已通过
    37
    上传者