Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- char c[255] = { "123 321 8544 4458 7544" };
- void all(char*) {
- for (int i = 0; *(c + i) != '\0'; i++) {
- if (*(c + i) == ' ') {
- for (int j = i; *(c + j) != '\0';j++) {
- if (*(c + j) == ' ') {
- for (int f = i-1, s = j+1; (*(c + s) != ' ') || (*(c + f) != ' '); f--, s++) {
- if (*(c + s) != *(c + f)) {
- break;
- }
- if ((*(c + s+1) == ' ') || (*(c + f-1) == ' ')) {
- cout << *(c + f)<<' ';
- break;
- }
- }
- }
- }
- }
- }
- }
- int main() {
- all(c);
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement