2 câu trả lời
var s, ho: string[50];
i: byte;
Begin
Write('nhap ho ten: '); readln(s);
For i:=2 to length(s) do if s[i]=' ' then
Begin
ho:=copy(s, 1, i-1);
Break;
End;
Write('ho: ', ho);
End.
program ho_trongxau;
uses crt;
var s:string;
i:byte;
begin
clrscr;
write('Nhap ho va ten: '); readln(s);
i:=1;
while s[i]<>' ' do
begin
write(s[i]);
i:=i+1;
end;
readln;
end.