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 00448322 at 2005-05-03 21:08:33 on Problem 2419
#include <iostream.h>
#include <string.h>

char num[100][100];
bool save[100];

void main()
{
	
	int i,j,k;
	for(i=0;i<100;i++)
		for(j=0;j<100;j++)
			num[i][j]='t';
	int P,T;
	int count=0;
	cin>>P>>T;
	for(i=0;i<P;i++)
		num[i][T]='\0';
	while(cin)
//	for(k=0;k<6;k++)
	{
		cin>>i>>j;
		num[i-1][j]='p';
	}
	for(i=0;i<P && save[i]==false;i++)
	{
		for(j=i+1;j<P&&save[j]==false;j++)
		{
			
			if(strcmp(num[i],num[j])==0)
			{
				save[j]=true;
			}
		}
		count++;
	}
	cout<<count;
}

	

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