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 00448224 at 2005-03-10 22:37:14 on Problem 2136
#include<iostream.h>
void main()
{
	char ch[4][73],letter[26];
	int n[26],max;
	for(int i=0;i<4;i++)
		cin.getline(ch[i],73);
	for(i=0;i<26;i++)
	{
		letter[i]='A'+i;
		n[i]=0;
	}
	for(i=0;i<4;i++)
		for(int j=0;j<73;j++)
			if(ch[i][j]>='A'&&ch[i][j]<='z')
				n[ch[i][j]-'A']++;
	max=n[0];
	for(i=0;i<26;i++)
		if(n[i]>max)
			max=n[i];
	while(max)
	{
		for(i=0;i<26;i++)
		{
			if(n[i]<max)
				cout<<"  ";
			else
				cout<<"* ";
		}
		cout<<endl;
		max--;
	}
	for(i=0;i<26;i++)
		cout<<letter[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