#include <iostream>
#include <string>
using namespace std;
int main()
{
string str[12];
string tmp;
int y=0,x=0,b=0;
while(1)
{
cout<<"now,input a word:";
getline(cin,tmp);
for(int i=b;i<12;i++)
{
if(str[i]==tmp)
{
cout<<"find the some word occurs two times:"<<tmp<<endl;
cout<<"break out from while"<<endl;
y=1;
break;
}
else y=0;
}
if(y==1)break;
cout<<"no find the some,continue"<<endl;
str[x++]=tmp;
b=x-1;
}
system("pause");
return 0;
}
#include <string>
using namespace std;
int main()
{
string str[12];
string tmp;
int y=0,x=0,b=0;
while(1)
{
cout<<"now,input a word:";
getline(cin,tmp);
for(int i=b;i<12;i++)
{
if(str[i]==tmp)
{
cout<<"find the some word occurs two times:"<<tmp<<endl;
cout<<"break out from while"<<endl;
y=1;
break;
}
else y=0;
}
if(y==1)break;
cout<<"no find the some,continue"<<endl;
str[x++]=tmp;
b=x-1;
}
system("pause");
return 0;
}