标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 29860 Accepted Submission(s):
8230
X 2 A 7 @
X
XXX
A
A A
A A
A A
A A
A A
AAAAAAAAAAAAA
#include<iostream> using namespace std; int main() { int n,l=1; char ch; while(1) { cin>>ch; if(ch==‘@‘) break; cin>>n; if(l!=1) cout<<endl; for(int i=0;i<n-1;i++) { for(int j=0;j<n-1-i;j++) cout<<‘ ‘; cout<<ch; for(int j=0;j<2*i-1;j++) cout<<‘ ‘; if(i!=0) cout<<ch; cout<<endl; } for(int k=2*n-1;k>0;k--) cout<<ch; cout<<endl; l++; } return 0; }
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4556340.html