strstr
  • 板块灌水区
  • 楼主CuSO4_and_5H2O
  • 当前回复2
  • 已保存回复2
  • 发布时间2022/3/14 20:13
  • 上次更新2023/10/28 06:35:21
查看原帖
strstr
231946
CuSO4_and_5H2O楼主2022/3/14 20:13

不会用str,,,,,```

#include<bits/stdc++.h>
using namespace std;
char a[1111],b[1111];
int main()
{
	cin>>a;
	cin>>b;
	cout<<strstr(a,b);
	/*if(strstr(a,b)!="NULL")
	{
		cout<<b<<" is substring of "<<a;
		return 0; 
	}
	if(strstr(b,a)!="NULL")
	{
		{
		cout<<a<<" is substring of "<<b;
		return 0; 
	}
	}
	cout<<"No substring";*/
}

为什么输入asdasd和asd输出的是asdasd输入asd和qwe啥都没有

2022/3/14 20:13
加载中...