Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 29368 Accepted Submission(s):
8074
#include<stdio.h> #include<string.h> int main() { char a; int n,m,j,i,s; int t=0; while(scanf("%c",&a)!=EOF) { if(a=='@') break; scanf("%d",&n); //printf("\n"); if(t>0) printf("\n"); t++; getchar(); m=n;s=n; for(j=1;j<n;j++) printf(" "); printf("%c",a); printf("\n"); for(i=2;i<=s-1;i++) { for(j=1;j<n-1;j++) printf(" "); n=n-1; printf("%c",a); for(j=n+1;j<m+1;j++) printf(" "); m=m+1; printf("%c",a); printf("\n"); } if(s>1) { for(i=1;i<=2*s-1;i++) { printf("%c",a); } printf("\n"); } } return 0; }