求大佬找找我bug
#include<bits/stdc++.h>
using namespace std;
int main()
{
string a,b;
while(cin >> a >> b)
{
int s1 = a.length();
int s2 = b.length();
int i,j,k,p;
int flag = 0;
int q = 0;
for(i = 0; i < s1; i++)
{
if(a[i] == b[0])
{
for(j = 0,p = i; j < s2,p < s1; p++,j++)
{
if(a[p]!=b[j])
{
break;
}
}
if(p == s1)
{
flag = 1;
for(k = i; k < s1; k++)
{
cout << a[k];
}
q = 1;
cout << endl;
break;
}
}
}
if(q == 0)
{
cout << "NULL!\n";
}
}
return 0;
}
using namespace std;
int main()
{
string a,b;
while(cin >> a >> b)
{
int s1 = a.length();
int s2 = b.length();
int i,j,k,p;
int flag = 0;
int q = 0;
for(i = 0; i < s1; i++)
{
if(a[i] == b[0])
{
for(j = 0,p = i; j < s2,p < s1; p++,j++)
{
if(a[p]!=b[j])
{
break;
}
}
if(p == s1)
{
flag = 1;
for(k = i; k < s1; k++)
{
cout << a[k];
}
q = 1;
cout << endl;
break;
}
}
}
if(q == 0)
{
cout << "NULL!\n";
}
}
return 0;
}