Скачиваний:
20
Добавлен:
06.02.2016
Размер:
786 б
Скачать
unit modul03;

interface procedure TrueFloat(var s: string);

implementation
procedure TrueFloat(var s: string);
var i: byte; c,k: integer;
begin

i:=1;
repeat
if copy(s,i,2)=',,' then
s:=copy(s,1,i)+copy(s,i+2,length(s)-(i+1))
else i:=i+1
until (i>length(s));

i:=1;
repeat
if copy(s,i,2)='..' then
s:=copy(s,1,i)+copy(s,i+2,length(s)-(i+1))
else i:=i+1
until (i>length(s));

k:=pos(',',s);
if k>0 then s[k]:='.';

end;

procedure TrueInt(s:string);
const z=':;! ,./';
var c,i:integer; num: real;
begin
for i:=1 to length(s) do
if pos(s[i],z)>0
then begin delete(s,i,1);
dec(i);
end;
val(s,num,c);
writeln('Откорректированное число: ',num);
end;
end.
Соседние файлы в папке 8 лаб. Модульное программирование