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 flyinthesky at 2005-04-09 13:01:07 on Problem 2136
#include<iostream.h>

void main()
{
   char ch[4][73],a[27];
	int b[26],max;
	for(int i=0;i<4;i++)
		cin.getline(ch[i],73);
	for(i=0;i<26;i++)
	{
		a[i]='A'+i;
	}
	for(i=0;i<26;i++)
	{
		b[i]=0;
	}
	for(i=0;i<4;i++)
		for(int j=0;j<73;j++)
			if(ch[i][j]>='A'&&ch[i][j]<='z')
				b[ch[i][j]-'A']++;

   
   
 max=b[0];
	for(i=0;i<26;i++)
		if(b[i]>max)
			max=b[i];
while(max)
	{
		for(i=0;i<26;i++)
		{
			if(b[i]<max&&b[i]>0)
				cout<<"  ";
			else if(b[i]==0)
				  continue;
			     else
				cout<<"* ";
		}
		cout<<endl;
		max--;
	}
	for(i=0;i<26;i++)
	{	if(b[i]!=0)
		cout<<a[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