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:一次刷过。贴个代码:In Reply To:一次刷过。贴个代码: Posted by:0810311106 at 2009-09-12 16:48:15 > #include"stdio.h" > #include"string.h" > int main() > { > char a[110]; > int map[100]={0}; > int i,j,max=0; > for(i=0;i<4;i++) > { > gets(a); > for(j=0;j<strlen(a);j++) > if(a[j]>='A'&&a[j]<='Z') > { > map[a[j]]++; > if(max<map[a[j]]) > max=map[a[j]]; > } > } > for(j=max;j>=1;j--) > { > for(i='A';i<='Z';i++) > { > if(map[i]<j) > printf(" "); > else > { > map[i]--; > printf("* "); > } > } > printf("\n"); > } > for(i='A';i<='Z';i++) > printf("%c ",i); > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator