Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:一次刷过。贴个代码:这个我不知道为什么WA。。。In Reply To:一次刷过。贴个代码: Posted by:0810311106 at 2009-09-12 16:48:15 #include <stdio.h> #include <string.h> char a[27][400]={0,}; int main(){ int n=4,i,j; char buf[100]; char c; int max=0; while(n--){ gets(buf); for(i=0;i<strlen(buf);i++){ if(buf[i]>='A' && buf[i]<='Z'){ c=buf[i]-'A'+1; a[c][strlen(a[c])]='*'; if(strlen(a[c])>max){ max=strlen(a[c]); } } } } for(i=max-1;i>=0;i--){ for(j=1;j<=26;j++){ printf("%c",a[j][i]); if(j<26) printf(" "); } printf("\n"); } for(i=1;i<=26;i++) { printf("%c",i+'A'-1); if(i<26) printf(" "); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator