Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- ifstream cin("input.txt");
- short n;
- cin>>n;
- bool no = true;
- string pre = "", pre2 = "";
- for(int i = 0; i < n; i++)
- {
- string cur;
- cin>>cur;
- if (pre2 == cur)
- {
- if (no)
- no = false;
- cout<<i<<' ';
- }
- pre2 = pre;
- pre = cur;
- }
- if (no)
- cout<<-1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement