Make sure that if you are using the string data type, you type the preprocessor directive: #include <string>
That should fix some of the issues.
If you want the program to repeat anything put twice besides t, you must have first equal second after the output as so:
1 2 3 4 5
while (cin >> second)
{
if (second == first) cout << "repeated" << endl;
first = second;
}
I also recommend using endl so that after "repeated" is output, the next input will be asked for on the next line.