Program raspis;
Uses Crt;
Var spisok : array [1..10] of string;
time, comment : string;
time_enter,sort: boolean;
enter, buf1, buf2 : string;
i,j,m,mas : integer;
Begin
ClrScr;
Repeat
Writeln('1 - look spisok; 2 - add line in spisok; 3 - exit.');
ReadLn(m);
time:=''; comment:='';
Case m of
1: begin
ClrScr;
for i:=1 to mas do
begin
WriteLn(spisok[i]);
end;
end;
2: begin
ClrScr;
Writeln('Enter new line');
ReadLn(enter);
For i:=1 to length(enter) do
begin
if (enter[i]=':') and
((enter[i-2]<'0') or
((enter[i-2]>='0') and (enter[i-2]<='2')) and
((enter[i-1]>='0') and (enter[i-1]<='9')) and
((enter[i+1]>='0') and (enter[i+1]<='5')) and
((enter[i+2]>='0') and (enter[i+2]<='9'))) then
begin
for j:=0 to 4 do
begin
if (j=0) and (i=2) then time:='0'
else time:=time+enter[i-2+j];
end;
time_enter:=true;
if (i=2) or (i=3) then
begin
comment:='';
i:=i+3;
end
else
begin
comment[i-2]:=chr(0);
comment[i-1]:=chr(0);
i:=length(enter);
end;
end
else
begin
comment:=comment+enter[i];
end;
end;
if time_enter=true then
begin
if mas<>0 then
begin
for i:=1 to mas+1 do
begin
if sort=false then
begin
buf1:=spisok[i,1]+spisok[i,2]+spisok[i,3]+spisok[i,4]+spisok[i,5];
if time<buf1 then
begin
sort:=true;
buf1:=spisok[i];
spisok[i]:=time+' - '+comment;
end;
end
else
begin
buf2:=spisok[i];
spisok[i]:=buf1;
buf1:=buf2;
end;
if (i=mas+1) and (sort=false) then spisok[i]:=time+' - '+comment;
end;
end
else
begin
spisok[1]:=time+' - '+comment;
end;
ClrScr;
end
else Writeln('You not do enter TIME. You line not save');
Sort:=False;
time_enter:=false;
mas:=mas+1;
end
else
begin
ClrScr;
Writeln('Error enter comando');
end;
end;
Until m=3;
End.
Похожие записи/страницы:
- C клавиатуры ввести натуральные числа k>1,m>1,n>1 и вещественные компоненты трёх векторов…
- Построение треугольника по трем точкам - Pascal(Паскаль)
- Числа a, b, c обозначают дату. Определить сколько полных дней осталось до конца года- Pascal(Паскаль)
- Удалить из введённой строки все удвоенные подряд стоящие символы - Pascal(Паскаль)
- Заданы координаты трех вершин треугольника (x1, y1), (х2, y2), (x3, y3). Найти его периметр и площадь - Pascal(Паскаль)
- За несколько буханок хлеба по две монеты и несколько банок консерв заплатили 100 монет.Сколько могли купить…
- Составить массив 5*6 заполненный с клавиатуры :1.Заменить 2-ой элемент каждой строки на…
- Дан двумерный массив с размерностью 8*7,заполненный случайным образом.-заменить все элементы первых трех…