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

恩,不错不错,读题和调程序都比以前细心了,1A

Posted by darkcaller at 2010-12-19 14:39:47 on Problem 2136
#include<stdio.h>
int main()
{
	int i,max_cnt;
	char ch;
	char cnt[26];
	//freopen("in.txt","r",stdin);
	for(i=0;i<26;i++)cnt[i]=0;
	for(i=0;i<4;i++)
	  while((ch=getchar())!='\n')
	  {
		  if(ch>='A'&&ch<='Z')++cnt[ch-'A'];
	  }
	for(max_cnt=0,i=0;i<26;i++)
	{
		if(cnt[i]>max_cnt)max_cnt=cnt[i];
	}
	while(max_cnt)
	{
		int s;
		for(i=0;i<26;i++)
		{
			if(cnt[i]>=max_cnt)s=i;
		}
		for(i=0;i<s;i++)
		{
			if(cnt[i]>=max_cnt)printf("* ");
			else printf("  ");
		}
		printf("*\n");
		--max_cnt;
	}
	for(i=0;i<25;i++)printf("%c ",i+'A');
	printf("Z\n");
	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