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 zover2008 at 2008-12-26 14:24:17 on Problem 2192
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
   int n=0,i=0,j=0,p=0,k=0,icount=0,count=0,o=1,a,b,c;
   char s[1005],t[1005],q[1005];
   scanf("%d",&n);
   while(n--)
   {
         scanf("%s %s %s",s,t,q);
         a=strlen(s);
         b=strlen(t);
         c=strlen(q);
         while(j<a&&k<c)
         {
             if(s[j]==q[k])
             {
                icount++;
                k++;
                j++;
             }
             else
             {
                k++;
             }
         }
         while(i<b&&p<c)
         {
             if(t[i]==q[p])
             {
                count++;
                p++;
                i++;
             }
             else
             {
                p++;
             }
         }
         if(icount==a&&count==b)
         {
             printf("Date set %d: yes\n",o);
         }
         else
         {
             printf("Date set %d: no\n",o);
         }
         o++;
         i=0;
         j=0;
         k=0;
         p=0;
         icount=0;
         count=0;
   }
   system("PAUSE");
   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