Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для contrafuckt

Новый участник


Сообщения: 1
Благодарности: 1

Профиль | Отправить PM | Цитировать


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.

Последний раз редактировалось Drongo, 28-04-2009 в 13:53. Причина: Тег [code]...[/code]

Это сообщение посчитали полезным следующие участники:

Отправлено: 12:07, 28-04-2009 | #22