Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program dz5_1;
- uses crt;
- type
- sl = string[30];
- fil = file of sl;
- var
- s: fil;
- slovo: sl;
- mas: array [1..100] of sl;
- N, ch, i: integer;
- check: char;
- procedure readx;
- begin
- assign (s, 'C:\Users\Xiaomi\Desktop\qqq.dat');
- reset (s);
- i:=1;
- while not eof (s) do begin
- read(s, slovo);
- mas[i] := slovo;
- inc(i);
- end;
- close(s);
- end;
- procedure writex;
- begin
- assign (s, 'C:\Users\Xiaomi\Desktop\qqq.dat');
- rewrite (s);
- writeln('How?');
- readln(N);
- ch := N;
- writeln('Input words:');
- while (N>0) do
- begin
- readln(slovo);
- write(s,slovo);
- dec(N);
- end;
- close(s);
- end;
- procedure output;
- var j:integer;
- begin
- writeln('Words from file:');
- for j:=1 to ch do
- writeln(mas[j]);
- end;
- procedure checkx;
- var i, j, p: integer;
- begin
- for i:=1 to ch do
- for j:=i+1 to ch do
- if mas[i]=mas[j] then
- begin
- dec(ch);
- for p:= j to ch-1 do
- mas[p]:=mas[p+1];
- end;
- writeln('Without povtor:');
- for i:=1 to ch do
- writeln(mas[i]);
- end;
- begin
- check := 'a';
- while check <> 'q' do
- begin
- writex;
- readx;
- output;
- checkx;
- Write('If you want to exit press "q", if you want to continue: open qqq.txt, enter a new text, save, press random botton: ');
- readln (check);
- writeln;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement