Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. char c[255] = { "123 321 8544 4458 7544" };
  5.  
  6. void all(char*) {
  7. for (int i = 0; *(c + i) != '\0'; i++) {
  8. if (*(c + i) == ' ') {
  9. for (int j = i; *(c + j) != '\0';j++) {
  10. if (*(c + j) == ' ') {
  11. for (int f = i-1, s = j+1; (*(c + s) != ' ') || (*(c + f) != ' '); f--, s++) {
  12. if (*(c + s) != *(c + f)) {
  13. break;
  14. }
  15. if ((*(c + s+1) == ' ') || (*(c + f-1) == ' ')) {
  16. cout << *(c + f)<<' ';
  17. break;
  18. }
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25.  
  26. int main() {
  27. all(c);
  28. cin.get();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement