Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

不是很懂为什么WA......哪位大神帮忙看一下么

Posted by sapphirebitter at 2017-07-22 16:04:08 on Problem 2136
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator