3 solutions

  • 1
    @ 2024-11-17 15:39:04
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	string s1,s2;
    	cin>>s1>>s2;
    	if(s1.find(s2)!=-1)
    	{
    		cout<<s1.find(s2);
    	}
    	else
    	{
    		cout<<-1;
    	}
    	return 0;
    }
    • -1
      @ 2024-6-5 18:23:31

      #include<bits/stdc++.h> using namespace std; int main(){ string s1,s2; cin>>s1>>s2; if(s1.find(s2)!=-1) { cout<<s1.find(s2); } else { cout<<-1; } return 0; }

      • -1
        @ 2024-6-5 18:23:26

        #include<bits/stdc++.h> using namespace std; int main(){ string s1,s2; cin>>s1>>s2; if(s1.find(s2)!=-1) { cout<<s1.find(s2); } else { cout<<-1; } return 0; }

        • 1

        Information

        ID
        93
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        1
        Tags
        (None)
        # Submissions
        44
        Accepted
        29
        Uploaded By