标签:des style blog http color os io java strong
Time Limit: 1000 MS Memory Limit: 30000 KB
64-bit integer IO format: %I64d , %I64u Java class name: Main
sequence subsequence person compression VERDI vivaVittorioEmanueleReDiItalia caseDoesMatter CaseDoesMatter
Yes No Yes No
题意:第一个串是否是第二个的子串 区分大小写 依旧前几道题暴力的思想
#include <iostream> #include <string.h> #include <stdio.h> using namespace std; int main() { long long int i,j; ///int会超 char s1[100000],s2[100000]; while(scanf("%s",s1)!=EOF) { scanf("%s",s2); long len1=strlen(s1); long len2=strlen(s2); i=0; j=0; while(true) { if(i==len1) { cout<<"Yes"<<endl; break; } else if(i<len1 && j==len2) { cout<<"No"<<endl; break; } if(s1[i]==s2[j]) { i++; j++; } else j++; } memset(s1,‘\0‘,sizeof(s1)); memset(s2,‘\0‘,sizeof(s2)); } return 0; }
标签:des style blog http color os io java strong
原文地址:http://www.cnblogs.com/zhangying/p/3947690.html