7 条题解
-
-3
#include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; #define LL long long const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int main() { int n; cin >> n; for(int i = 1 ; i <= n + 1 ; i++) { for(int j = 1 ; j <= n * 2 + 1 ; j++) { if(n - i + 2 == j || n + i==j) cout << "*"; else cout << " "; } cout << endl; } for(int i = n ; i >= 1 ; i--) { for(int j = 1 ; j <= n * 2 + 1 ; j++) { if(n - i + 2 == j || n + i == j) cout << "*"; else cout << " "; } cout << endl; } }
信息
- ID
- 952
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 2
- 标签
- 递交数
- 355
- 已通过
- 219
- 上传者