輸入兩個字符串判斷第二個字符串是不是第1個字符串的子串?
//#include "stdafx.h"http://If the vc++6.0, with this line. #include <string> #include <iostream> using namespace std; int main(int argc,char *argv[]){ string s1,s2; cout << "Input 2 strings...\n"; cin >> s1 >> s2; cout << (s1.find(s2)!=string::npos ? "Yes" : "No") << endl; return 0; }