="justify"> # include
# include
# include
# include
}; search {index; size;
};
# include "C: BORLANDC Progs kurs alg.cpp"
# include "C: BORLANDC Progs kurs menu.cpp". CPP_new (intn, posled * p) {> size = n;> element = new int [n] ;
} _delete (posled * p) {p-> element;
} _rand (posled * p) {(inti = 0; i
size; i + +) {> element [i] = random (randmax);
}
} _search (posled * p, intnum) {= 1, len = 1, indmax = -1; = 1; (inti = 1; i <= p-> size; i + +) { (p-> element [i] == p-> element [i-1] && i
size) len + +; {(len> lenmax) {= len; (num == 1 ) indmax = i-len; = -1; = 1;
} if (len == lenmax) {+ +; (nummax == num) indmax = i-len;
} = 1;
}
} = {0};. index = indmax;. size = lenmax;;
} _save (char * path, posled * p) {* f; = fopen (path, "w +"); (! f) return; (f, "% d" ;, p-> size); (inti = 0; i
size; i + +) fprintf (f, "% d", p-> element [i]); (f);
} _open (char * path, posled * p) {* f; = 0, i = 0; = fopen (path, "r"); (! f) {_new (0, p);;
} (f, "% d", & buf); _new (buf, p); (! feof (f)) {= 0; (f, "% d" ;, & buf);> element [i + +] = buf;
} (f);
}. CPP_note () {(1,15); (180,50,460,430); (1,0); (inti = 0; i <3; i + +) fillellipse (i * 80 +240 , 75,10,10); (1,2); (i = 0; i <3; i + +) {(i * 80 +236,73, i * 80 +238,40); (i * 80 +242 , 73, i * 80 +244,40);
}
} start () {_set = 0; work = 0; (start_set <0) start_set = 1; if (start_set> 1) start_set = 0; (); _note (); (0, 0,2); setcolor (4); (320,120, "Create {27: menu (); return; 80: start_set + +; break; 72: start_set -; break; 13: = 1; (start_set) {0: posl_open (gpath, posl); break; 1: posled_new (48, posl ); posled_rand (posl); break;
};
} (work) {_note (); [15] = {0}; j = 1; m = {0}; (! posl-> size) {(320,220, "Cannot open file "); (); menu (); return;} (inti = 0; i size; i + +)
} (m.index> = 0) {= index_search (posl, j + +); (m.index == -1) break; (int k = 0; k
+ (l% 6) * 40,144 + (l/6) * 30);
}
} (buf, "Size:% d", m.size); (320,125 + (i +1) * 5, buf); (bool_so) posl_save (gpath_2, posl); _save (gpath, posl); (); menu ();
} ();
} options () {_note (); _sel = 0; (opt_sel <0) opt_sel = 1; else if (opt_sel> 1) opt_sel = 0; (0,0,3); setcolor (4); (320,120,...