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 summery at 2006-04-07 22:03:53 on Problem 2136
#include<iostream>
#include<string>
using namespace std;
int main()
{
    string s[4];
    int a[26];
    int max=-1;;
    for(int c=0 ; c<26; c++)
    a[c] =0;
    
    for(int k =0; k<4; k++)
     getline(cin,s[k]);
     
    for(int i =0; i<4; i++)
     for(int j =0; j<s[i].length(); j++)
     {
     if((int(s[i][j])-65)>=0&&(int(s[i][j])-65)<26);       
      a[int(s[i][j])-65]++; 
      }//统计每个字符出现的次数 
      
     for(int p =0; p<26; p++)
    {
     if(max<a[p])
     max =a[p];
    }//找出字符出现频率的最大值 
    //cout<<max<<endl;
    for(int pp=max; max>0; max--)
    {
     for(int cc=0; cc<26; cc++)
     {
      if(a[cc]>=max)
       cout<<"* ";
      else cout<<"  ";
     }
     cout<<endl;
    }
    
    for(int ccc=0; ccc<26; ccc++)
    cout<<char(65+ccc)<<" ";
             
     system("PAUSE");
     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