ответ:
var
str: string;
i, count: integer;
begin
write('your string: ');
readln(str);
i : = length(str);
if i > 0 then begin
count : = 1;
while i > 0 do begin
if str[i] = ' ' then
count : = count + 1;
i : = i - 1;
end;
end
else
count : = 0;
writeln('number of words: ', count);
readln;
end.
объяснение:
ответ: попробуй
объяснение:
void __fastcall tform1: : button1click(tobject *sender)
{
int count = 0;
tstringlist *list = new tstringlist; // г±г®г§г¤г*гґг¬ г±гїгёг±г®гє
list-> loadfromfile("f: \\гљгіг«гјгігёг*\\info.txt");
memo1-> text = list-> text;
list-> delimitedtext = memo1-> text;
memo2-> text = list-> delimitedtext;
for (int i=0; i < list-> count; i++)
{
if ( list-> strings[i].length() < = 4 )
{
count++;
}
}
label1-> caption = inttostr(count);
delete list;
list = null;
}
действие будет =1
Объяснение: