#include<iostream>
#include<string>
using namespace std;
int main()
{
int count1 = 0;
int count2 = 0;
int i = 0;
int action = 0;
string str("abcdefghi");
cout << str << endl;
cout <<"请输入字符字串:"<<endl;
string str1;
cin >> str1;
/* while(str1[count2] != '\0')
{
count2++;
i++;
}*/
i = str1.length();
//cout << i << endl;
count2 = 0;
while(str[count1] != '\0')
{
if(str1[count2] == str[count1])
{
action = count1;
while(str1[count2] == str[count1])
{
count1++;
count2++;
}
if(i == count2)
{
cout<<"首字符位置:"<< action <<endl;
}
else
{
cout <<"没有这个字串" <<endl;
}
break;
}
count1++;
}
}