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

高手帮帮忙啊`````郁闷!!第一次碰到Output Limit Exceed,求救!!

Posted by Azaza at 2005-08-13 12:32:49 on Problem 2136
#include<iostream>
#include<string>
#define MAX 108
using namespace std;
typedef struct zim{
	int sign[MAX];
}zimu;
zimu zz[65];
int temp=-1;
int kk[MAX]={0};
char last[MAX];
void com(string s)
{
	for(int i=0;i<s.size();kk[s[i]-65]++,i++)
		if(s[i]<='Z'&&s[i]>='A')
			zz[s[i]-65].sign[kk[s[i]-65]]=1;
}
void getlast()
{
	for(int j=0;j<26;j++)
		if(kk[j]>temp)
			temp=kk[j];
	for(int te=temp;te>=0;te--)
		for(int i=25;i>=0;i--)
			if(zz[i].sign[te]==1)
			{
				last[te]=(char)(i+65);
				break;
			}
}
void output()
{
	for(int i=0;i<=temp;i++)
	{
		for(int k=0;k<=(int)last[temp-i]-65;k++)
		{
			if(k!=0)
				cout<<' ';
			if(zz[k].sign[temp-i]==1)
				cout<<"*";
			else cout<<" ";
		}
		cout<<" "<<endl;
	}
	cout<<'A';
	for(i=66;i<=90;i++)
		cout<<' '<<(char)i;
	cout<<endl;
}
void main()
{
	while(1)
	{
		string s;
		for(int i=0;i<4;i++)
		{
			getline(cin,s);
			com(s);
		}
		getlast();
		output();
	}
}
//哪们大哥能帮帮忙啊!!加我QQ52203336,或者直接把程序改好,发到我邮箱里 GFVTK@126.COM 先谢谢了

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