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

仔细看题目。输出是有空格隔开的

Posted by hawk at 2004-12-07 18:52:40 on Problem 2136
In Reply To:为什么总是Presentation Error,救救我!!!!! Posted by:id110202 at 2004-12-07 18:48:38
> #include<iostream.h>
> int main()
> {
>     int a[26];
>     int i,line,t;
>     char ch;
>     for(i=0;i<26;i++) a[i]=0;
>     while(cin>>ch)
>     {
>         if(ch<'A'||ch>'Z') continue;
>         ++a[ch-'A'];
>     }    
>     line=0;
>     for(i=0;i<26;i++)
>         if(line<a[i]) 
>         {
>             line=a[i];
>         }
>     line++;
>     while(--line>0)
>     {
>         t=26;
>         while(a[--t]<line);
>         for(i=0;i<=t;i++) 
>         {
>             cout<<(a[i]>=line?'*':' ');
>         }
>         cout<<endl;        
>     }   
>     for(i=0;i<26;i++)
>     {
>         cout<<char('A'+i);
>     }
>     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