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 wwwwwwking at 2007-12-26 15:57:44 on Problem 1936
In Reply To:真的很郁闷!!!这两个程序有差别吗? Posted by:xtu716 at 2007-08-08 19:59:21
#include <stdio.h>
#include <string.h>
int main ()
{
   char a[10000]={'\0'},b[10000]={'\0'};
   int c,d;
   int i,j;
   while (EOF!=scanf ("%s%s",a,b))
   {
      c=strlen(a);
      d=strlen(b);
      if (c>=d)
      {
	 i=0;j=0;
	 while (a[i]!='\0')
	 {
	   if (a[i]==b[j])
	   {
	     i++;j++;
	   }
	   else i++;
	 }
	 if (j==d) printf ("Yes\n");
	 else printf ("No\n");
      }
      if (c<d)
      {
          i=0;j=0;
	 while (b[i]!='\0')
	 {
	   if (b[i]==a[j])
	   {
	     i++;j++;
	   }
	   else i++;
	 }
	 if (j==c) printf ("Yes\n");
	 else printf ("No\n");
      }
   }
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