Advertisement
Grisha1549

Untitled

Jan 21st, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.33 KB | None | 0 0
  1. //#include <stdio.h>
  2. //#include <malloc.h>
  3. //#include <time.h>
  4. //#include <stdlib.h>
  5. //#include <conio.h>
  6. //#include <math.h>
  7. //#include <iostream>
  8. //#include <string.h>
  9. //int leng;
  10. ////char* str(char *s1, char *s2, int leng1, int leng2)
  11. //char* str(char *s1, char *s2, int leng1, int leng2)
  12. //{
  13. //  char *strret;
  14. //  strret = new char[leng1 + leng2 + 1];
  15. //  int k,l=0;
  16. //  for (int i = 0; i < leng1; i++)
  17. //  {
  18. //      if (s1[i] == s2[0])
  19. //      {
  20. //          k = 0;
  21. //          for (int j = 0; j < leng2; j++)
  22. //              if (s1[i + j] == s2[j])k++;
  23. //          if (k == leng2) i += leng2-1;
  24. //          else {
  25. //              strret[l] = s1[i]; l++;
  26. //          }
  27. //      }
  28. //      else {
  29. //          strret[l] = s1[i]; l++;
  30. //      }
  31. //     
  32. //  }
  33. //  return strret;
  34. //}
  35. //int main()
  36. //{
  37. //  setlocale(LC_ALL, "Russian");
  38. //  int n, m;
  39. //  char *s, *s0, *str1;
  40. //  str1 = new char[256];
  41. //  s = new char[256];
  42. //  s0 = new char[256];
  43. //  char c;
  44. //  c = 'a';
  45. //  printf_s("Введите строку s:");
  46. //  for (n=0; c !='\n';n++)
  47. //  {
  48. //      scanf_s("%c", &c);
  49. //      s[n]=c;
  50. //  }
  51. //  c = 'a';
  52. //  printf_s("Введите строку s0:");
  53. //  for (m = 0; c !='\n'; m++)
  54. //  {
  55. //      scanf_s("%c", &c);
  56. //      s0[m]=c;
  57. //  }
  58. //  m--;
  59. //  str1 = str(s, s0, n, m);
  60. //  printf_s("Итоговая строка: ");
  61. //  for (int i = 0; i < leng; i++)
  62. //      printf_s("%c", str1[i]);
  63. //  _getch();
  64. //  return 0;
  65. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement