You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
463 B
21 lines
463 B
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int n;
|
|
cin >> n;
|
|
//上面
|
|
for (int i = n; i > 1; i--) {
|
|
for (int j = 0; j <= n - i; j++)cout << " ";
|
|
cout << "*";
|
|
for (int j = 0; j < 2 * i - 1; j++)cout << " ";
|
|
cout << "*" << endl;
|
|
}
|
|
//下面
|
|
for (int i = 1; i <= n; i++) {
|
|
for (int j = 0; j < n + 1; j++)cout << " ";
|
|
cout << "*" << endl;
|
|
}
|
|
return 0;
|
|
} |