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 |
不是很懂为什么WA......哪位大神帮忙看一下么#include<cstdio> #include<iostream> #include<cstring> #include<string> #include<fstream> using namespace std; int main() { //freopen("in.txt","r",stdin); string s,buf;int count[26]={0}; int t; for(int j=0;j<4;j++) { getline(cin,s); for(int i=0;i<s.size();i++) { if(s[i]>64&&s[i]<91) { count[s[i]-'A']++; } } } int max=0; for(int i=0;i<25;i++) { if(count[i]>max) {max=count[i]; } } for(int i=max-1;i>-1;i--) { for(int j=0;j<26;j++) { if(count[j]>i) printf("*"); else printf(" "); if(j<25) printf(" "); } printf("\n"); } printf("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator