19int findmark(std::istream &file,
const char *s) {
22 char *fs =
new char[l + 1];
23 for (
int n = 0; n < l; n++) {
24 if ((ic = file.get()) == EOF) {
31 while (strcmp(fs, s) != 0) {
32 for (
int n = 1; n < l; n++) fs[n - 1] = fs[n];
33 if ((ic = file.get()) == EOF) {
49 int *pos_fs =
new int[q];
50 int s_init_pos_fs = 0;
53 for (i = 0; i < q; i++) {
55 if (l[i] > l_max) l_max = l[i];
60 char *fs =
new char[l_max + 1];
62 for (i = 0; i < q; i++) {
71 while ((ic = file.get()) != EOF) {
73 for (i = 1; i < l_max; i++) {
77 if (s_init_pos_fs == 0) {
79 for (i = 0; i < q; i++) {
80 if (l_max - pos_fs[i] < l[i]) {
88 if (ss == 1) s_init_pos_fs = 1;
90 for (i = 0; i < q; i++) {
91 if (strcmp(&(fs[pos_fs[i]]), s[i]) == 0) {
107 const std::string str[])
109 char **s =
new char *[q];
110 for (
int i = 0; i < q; i++) {
111 s[i] =
new char[strlen(str[i].c_str()) + 1];
112 strcpy(s[i], str[i].c_str());
115 for (
int i = 0; i < q; i++) {
int findmark(std::istream &file, const char *s)
int find1ofnmark(std::istream &file, int q, char *s[])