Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <string.h>
- #include <vector>
- #include <string>
- using namespace std;
- int main()
- {
- char diff;
- char inputstring[10000];
- string s;
- vector<string> dividedString;
- cin>>inputstring;
- int lend = strlen(inputstring);
- lend--;
- int group = lend/5;
- int first = 0;
- int second = 5;
- for(int j = 0; j < group ; j++)
- {
- for(int i = first; i < second; i++)
- {
- s.push_back(inputstring[i]);
- }
- dividedString.push_back(s);
- s = "";
- first += 5;
- second += 5;
- }
- if(lend < 4)
- {
- cout<<inputstring;
- }else
- {
- for(int i = 0;i < group;i++)
- {
- int cnt = 0;
- for(int j = 0;j < group ;j++)
- {
- if(dividedString[i] == dividedString[j])
- cnt++;
- }
- if(cnt == 1)
- {//its unique..print it
- cout << dividedString[i] <<endl;
- }
- }
- }
- // for(int j = 0; j < group ; j++)
- // {
- // cout<<dividedString[j]<<endl;
- // }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement