第一点不对!!
  • 板块B2118 验证子串
  • 楼主copuqw9
  • 当前回复2
  • 已保存回复2
  • 发布时间2024/12/29 14:50
  • 上次更新2024/12/29 19:16:54
查看原帖
第一点不对!!
1169115
copuqw9楼主2024/12/29 14:50

第一点不对!!

#include<bits/stdc++.h>
using namespace std;

char d[55],c[55];

int main()
{
	cin.getline(d,55);
	cin.getline(c,55);
	int flag=0,len1=strlen(d),len2=strlen(c);
	int k=0;
	if(strstr(d,c) != NULL) 
	{
		cout<<c<<" is substring of "<<d;
	}
	else if(strstr(c,d) != NULL) 
	{
		cout<<d<<" is substring of "<<c;
	}
	else 
	{
		cout<<"No substring";
	}
	return 0;
}
2024/12/29 14:50
加载中...