标签:一个 inpu href compress function concat special sam message
Time Limit: 1000MS | Memory Limit: 30000K | |
Total Submissions: 27537 | Accepted: 11274 |
Description
Input
Output
Sample Input
sequence subsequence
person compression
VERDI vivaVittorioEmanueleReDiItalia
caseDoesMatter CaseDoesMatter
Sample Output
Yes
No
Yes
No
Source
。。
就是推断字符串st1是不是字符串st2的字串。
#include <iostream> using namespace std; int main() { char st1[100000],st2[100000]; __int64 l1,l2,i,j; while(cin>>st1>>st2) { i=0;j=0; l1=strlen(st1); l2=strlen(st2); while(1) { if(i==l1) { printf("Yes\n"); break; } if(i<l1&&j==l2) { printf("No\n"); break; } if(st1[i]==st2[j]) { i++;j++; } else j++; } } return 0; }
标签:一个 inpu href compress function concat special sam message
原文地址:http://www.cnblogs.com/slgkaifa/p/7150002.html