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

fent怎么都看不出来错,ACM太狠了,高手指点一下吧

Posted by 00448323 at 2005-03-11 20:16:48 on Problem 2136
#include<iostream.h>
void main()
{
	char m,a[4][72];
	int b[26]={0};
	char c[26]={'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'};
	for(int i=0;i<4;i++)
		cin.getline(a[i],72);
	for(i=0;i<4;i++)
	{
		for(int j=0;j<72;j++)
		{
			m=a[i][j];
			if(m>='A'&&m<='Z')
			{
				int t=m-65;
				b[t]++;
			}
		}
	}
	int max=b[0];
	for(i=0;i<26;i++)
	{
		if(b[i]>max)
			max=b[i];
	}
	for( i=max;max>=0;max--)
	{	
		for(int j=0;j<26;j++)
		{
			if(b[j]>=max+1)
				cout<<"*";
			else
				cout<<" ";
			cout<<' ';
		}cout<<endl;
	}
	for(i=0;i<26;i++)
		cout<<c[i]<<' ';
	cout<<endl;
}








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