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

+U

Posted by sohu at 2008-10-04 20:26:53 on Problem 1318
In Reply To:我很郁闷!一个很小的地方错误了,害我调试3个多小时! Posted by:ecjtuQX at 2008-10-04 19:30:50
> 从这个题目我发现,我的基础很差!
> 要加强啊!
> 就是一个很小的地方错误了啊!
> //判断两个字符串是不是匹配!
> bool pei(char *s1,char *s2)
> {
> 	int len1,len2,i,j,count;
> 	int use[10];
> 	memset(use,0,sizeof(use));
> 	len1=strlen(s1);
> 	len2=strlen(s2);
> 	if(len1==len2)
> 	{
> 		count=0;
> 		for(i=0;i<len2;i++)
> 			for(j=0;j<len1;j++)
> 				if(!use[j]&&s2[i]==s1[j])
> 				{
> 					use[j]=1;
> 					count++;
> 					break;//开始这个地方错了啊!忘了break
> 				}
> 		if(count==len2)
> 			return true;
> 	}
> 	return false;
> }
> 希望后面的兄弟注意一下啊!
> 这个题目很简单,但是很阴!

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