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,怎么回事啊TAT

Posted by KAKA_R_M at 2013-03-23 14:48:42
代码如下,是2136
#include <iostream>
#include<string>
#include<cstring>
using namespace std;
int letter[26];

int main()
{
    memset(letter,0,sizeof(letter));
    for(int i = 0;i<4;i++)
    {
        string str;
        getline(cin,str);
        for(int j = 0;j<str.length();j++)
        {
            if( (str[j]-'A'>=0)&&(str[j]-'A'<=25) )
            letter[str[j]-'A']++;
        }
    }
    int maxl = 0;
        for(int i = 0;i<26;i++)
        {
            maxl = max(maxl,letter[i]);
        }
        for(int i = 0;i<maxl;i++)
        {
            for(int j = 0;j<26;j++)
            {
                if(letter[j]-maxl<0)
                {
                    letter[j]++;
                    cout<<" ";
                }
                else
                {
                    cout<<"*";
                    int judge = 0;
                    for(int t = j+1;t<26;t++)
                        if(letter[t]-maxl>=0)
                            judge = 1;
                    if(judge = 0){
                       cout<<endl;
                        break;
                    }

                }
                if(j!=25) cout<<" ";
            }
            cout<<endl;
        }
        cout<<"A B C D E F J H I J K L M N O P Q R S T U V W X Y Z"<<endl;
    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