С клавиатуры вводится три строки вида Фамилия пробел Имя пробел Рост.Определить фамилию и имя самого высокого человека d pascal abc

Ответы

Ответ дал: emblerik
0
type  str = array [1..100] of char;
var  maxs, tmps : str; 
count, max, tmp, ctmp : integer;

procedure reads (var s : str; var len, val : integer);
var 
b : boolean; 
 c : char; 
 i : integer;
begin 
 i := 0; b := false; 
 repeat 
  read (c); 
  if not b or (c <> ' ') then   
begin   
   if c = ' ' then b := true; 
    inc (i);   
   s[i] := c; 
    c := '1'; 
  end; 
 until b and (c = ' ');
  len := i; 
 readln (val);
end;
begin
assign (input, 'input.txt'); reset (input);
  reads (maxs, count, max); 
 while not eof do 
 begin   
 reads (tmps, ctmp, tmp);
    if tmp > max then   
 begin     
 max := tmp;
 count := ctmp; 
 maxs := tmps;
    end; 
end; 
 for tmp := 1 to count do write (maxs[tmp]);
end.



Ответ дал: ashekhanov
0
while pos(' ',s1)>0 do
begin
//s1:=copy(s1,1,pos(' ',s1));//первое слов
val(copy(s1,1,pos(' ',s1)),x,code);
delete(s1,1,pos(' ',s1));
if code=0 then
k:=k+x;
end;
ghgst:=k;
end;
var
s:string;
N:real;
begin
vvod(S);//Ввести строку S
N:=ghgst(S);//Посчитать сумму чисел N в строке S
writeln('В строке ',s,' су
Ответ дал: ashekhanov
0
все равно
Вас заинтересует