Войти

Показать полную графическую версию : Помогите решить задачу(Pascal)


Страниц : 1 [2]

Barrel
17-03-2009, 22:15
я ващев pascal не врубаюсь :( :o

contrafuckt
28-04-2009, 12:07
mozgabyte, держи :)

№1
const
infile='input.txt';
outfile='output.txt';
var
s,s1:string;
i:integer;
f,f1:text;
begin
assign(f,infile);
reset(f);
assign(f1,outfile);
rewrite(f1);
while not eof(f) do
begin
s1:='';
readln(f,s);
for i:=1 to length(s) do
if s[i]='A' then
if i>1 then s1:=s1+s[i-1];
writeln(f1,s1);
end;
close(f);
close(f1);
end.

№2
const
infile='input.txt';
outfile='output.txt';
N=10; {число N}
var
base:array[1..N]of integer;
f,f1:text;
mx,i:integer;
begin
assign(f,infile);
reset(f);
assign(f1,outfile);
rewrite(f1);
while not eof(f) do
begin
for i:=1 to n do
read(f,base[i]);
mx:=base[1];
for i:=2 to n do
if base[i]>mx then mx:=base[i];
writeln(f1,mx);
end;
close(f);
close(f1);
end.




© OSzone.net 2001-2012