文章
61
粉丝
137
获赞
18
访问
38.4k
#include<bits/stdc++.h>
using namespace std;
bool runjudge(int year);
int main(){
int n;
cin >>n;
int tmp[n+1];
tmp [1] = 1;
for(int i = 2; i <= n; i++)
tmp[i] =tmp[i-1] +2;
for(int i = 1; i <=n ;i++){
for(int j = 0; j < tmp[n]/2+1-i;j++) cout << " ";
for(int k = 0; k < tmp[i]; k++) cout << "*";
cout << endl;
}
for(int i = n-1; i >=1 ;i--){
for(int j = tmp[n]/2-i; j >= 0;j--) cout << " ";
for(int k = tmp[i] -1;k >= 0; k--) cout << "*";
cout << endl;
}
return 0;
...
登录后发布评论
暂无评论,来抢沙发