不是题解!!!
2023-11-25 11:32:22
发布于:上海
29阅读
0回复
0点赞
~~禁止阅读
#include<iostream>
#include<cstring>
char strA[128],strB[128],strC[128],str[255];int len,l,strlen_;int main(void){std::cin>>strA;std::cin>>strB;std::cin>>strC;len = strlen(strA),l = strlen(strB);for(int i = 0;i < len;i++){str[i] = strA[i];}for(int i = 0;i < l;i++){str[i+len] = strB[i];}strlen_ = strlen(str);for(int i = 0;i < strlen_;i++){if(str[i]==strC[0]){for(int j = 1;j < strlen_;j++){if(str[j+i]!=strC[j]&&strC[j]!='\0'){goto next;}}std::cout<<strC<<" is substring of "<<strA<<" and "<<strB;return 0;next: continue;}}std::cout<<strC<<" is not substring of "<<strA<<" and "<<strB;return 0;}
~~
全部评论 2
《不是题解>>
2024-07-30 来自 浙江
0nice
2023-12-02 来自 上海
0
有帮助,赞一个