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 limited exceed啊!那为高手帮忙看看,谢谢了!

Posted by lianxi at 2005-04-22 19:27:19 on Problem 1056
In Reply To:为什么一直是output limited exceed啊! Posted by:lianxi at 2005-04-22 18:45:34
 打击的 !
#include <iostream.h>
#include <string.h>

int set=1;
char get[100][200];
int i, j, k;
int count = 0;

void fun()
{
	for ( i = 1; i < count; i++ )
	{
		for ( j = i - 1; j >= 0; j-- )
		{
			for ( k = 0; get[i][k] != '\0' && get[j][k] != '\0'; k++)
			{
				if ( get[i][k] != get[j][k] )
					break;
			}
			if ( get[i][k] == '\0' || get[j][k] == '\0' )
			{
				cout << "Set " << set++ << " is not immediately decodable." << endl;
				count = 0;
				return;
			}
		}
	}
	cout << "Set " << set++ << " is immediately decodable." << endl;
	count = 0;
}

void main()
{
	while (true)
	{
		for ( i = 0; ; i++ )
		{
			cin >> get[i];
			if ( strcmp(get[i],"9") == 0 )
			{
				if ( i == 0 )
					return;
				break;
			}
			count++;
		}
		fun();
	}

}

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