字符串中find函数

洛谷1308 简化版 1.find() 查找第一次出现的目标字符串: #include #include using namespace std; int main(){ string s1 = “abcdef”; string s2 = “de”; int ans = s1.find(s2) ; //在S1中查找子串S2 cout<<ans<<endl; system(“pause”); } 说
相关文章
相关标签/搜索