标签:java circle div gets pac ring param 字符串 char
输入两个字符串,验证其中一个串是否为另一个串的子串。
abc dddncabca
abc is substring of dddncabca
思路:
大模拟;
来,上代码:
#include<cstdio> #include<string> #include<cstring> #include<algorithm> using namespace std; char word_1[201],word_2[201]; int main() { gets(word_1); gets(word_2); if(strstr(word_1,word_2)!=NULL) { printf("%s is substring of %s\n",word_2,word_1); return 0; } if(strstr(word_2,word_1)!=NULL) { printf("%s is substring of %s\n",word_1,word_2); return 0; } printf("No substring\n"); return 0; }
标签:java circle div gets pac ring param 字符串 char
原文地址:http://www.cnblogs.com/IUUUUUUUskyyy/p/6105104.html