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 |
偷懒做法~~~~~~~~~嘿嘿#include <iostream> #include <cstdlib> using namespace std; char ch, map[290][53]; int i, j, maxc, cnt[26]; int main(){ for( i = 0; i < 4; ++i ){ while ( (ch = getchar()) != '\n' ) { if(ch >= 'A' && ch <= 'Z') ++cnt[ch - 'A']; } } memset(map,' ',sizeof(map)); maxc = 0; for ( i = 0; i < 26; ++i ) { if(cnt[i] > maxc) maxc = cnt[i]; for ( j = 0; j < cnt[i]; ++j) { map[j][i << 1] = '*'; } } for ( i = 0; i < maxc; ++i ) { map[i][52] = '\0'; } if(maxc){ for ( i = maxc - 1; i >= 0; --i ) { printf("%s\n",map[i]); } } for ( i = 0; i < 26; ++i ) { printf("%c ",i + 'A'); } printf("\n"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator