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

Re:还行

Posted by Icanmey at 2009-09-08 02:27:08 on Problem 2136
In Reply To:还行 Posted by:chenjiang at 2009-08-24 14:38:07
#include<iostream>
#include<string>
#include<map>
using namespace std;
int num[27];
int main()
{
	char a_z[4][72];
	int i;
	for(i=0;i<4;i++)
		gets(a_z[i]);
	for(i=0;i<4;i++)
		for(int j=0;j<strlen(a_z[i]);j++)
		{
			if(a_z[i][j] >= 'A' && a_z[i][j] <= 'Z')
				num[a_z[i][j] - 'A']++;
		}
	int max=-1;
	for(i=0;i<27;i++)
		if(max < num[i])
			max = num[i];
	for(i=max;i>0;i--)
	{
		for(int k=0;k<27;k++)
			if(num[k]<i)
				cout<<"  ";
			else
				cout<<"* ";
		cout<<endl;
	}
	cout<<"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"<<endl;
	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