Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <stdlib.h>
  4. #include <string.h>
  5.  
  6. using namespace std;
  7.  
  8. int Compare (string a, string b, int c)
  9. {
  10. int i, n, j=0;
  11. n = a.size();
  12.  
  13. for (i=0;i<n;i++)
  14. {
  15. if (a[i] == b[c+i])
  16. j++;
  17. }
  18.  
  19. if (j == n)
  20. return 1;
  21. else
  22. return 0;
  23. }
  24.  
  25. int main()
  26. {
  27. int i=0, j=0, n=0, k=0;
  28. string input;
  29. input = "imagine a really really big string here";
  30. n = input.size();
  31.  
  32. string Map[200];
  33.  
  34. for (i=0;i<n;i++)
  35. {
  36. if (Compare("Competitive", input, i) == 1)
  37. {
  38. j++;
  39. i = i + 11;
  40. while (Compare("GMT", input, i) == 0)
  41. {
  42. Map[j][i] = input[i];
  43. i++;
  44. }
  45. }
  46. }
  47.  
  48. cout << Map[1];
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement