
20.12.2009, 00:40
|
Новичок
|
|
Регистрация: 11.12.2009
Сообщения: 76
Репутация: -26
|
|
Текстовые файлы в Делфи
Код:
{$APPTYPE CONSOLE}
uses
SysUtils;
var t1,t2:TextFile;
fam:string[15];
pol:char;
pr:integer;
su,okl:real;
begin
assign(t1,'1.txt');
assign(t2,'2.txt');
reset(t1);
rewrite(t2);
okl:=0;
su:=0;
while not eof(t1) do
begin
readln(t1,fam,pol,okl);
if pol='ж' then
begin su:=su+0.3*okl;
writeln(t2,fam,' ',pol,' ',okl,' ',su,' ',0.3*okl:0:0);
writeln(t2,fam,okl);
su:=su+pr;
end;
end;
if (su<>0) and (okl<>0) then
write(t2,su/okl:0:3);
closefile(t1);
closefile(t2);
end.
Последний раз редактировалось Asira, 27.12.2009 в 18:15.
|