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 meryhello at 2005-02-27 01:41:15 on Problem 2136
#include <iostream>
#include <memory>
using namespace std;

int main()
{
	char string[4][72];
	int count[26],i,t,j;

	memset(count,0,26*sizeof(int));
	for(i = 0;i<4; i++)
	{
		cin.getline(string[i],72);
	}
	for(i=0;i<(72*4);i++)
	{
		t=*(string[0]+i);
		if(t>='A'&&t<='Z')
			count[t-'A']++;
	}
	t=0;
	for(i=0;i<26;i++)
	{
		if(count[i]>t)
			t=count[i];
	}
	for(i=0;i<26;i++)
		count[i]=t-count[i];
	for(i=0;i<t;i++)
	{
		for(j=0;j<26;j++)
		{
			if(count[j]>0)
				cout<<"  ";
			else 
				cout<<"* ";
			count[j]--;
		}
		cout<<endl;
	}
	for(i=0;i<25;i++)
		cout<<(char)('A'+i)<<" ";
	cout<<'Z';
	cout<<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