Advertisement
Alex_Fomin

Алеся Зубова

Nov 7th, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.72 KB | None | 0 0
  1. // Дана строка символов, найти количество слов, имеющих четное количество букв.
  2. Program CPascal;
  3.  
  4. const mn=['a'..'z','A'..'Z','а'..'я','А'..'Я']; // Буквы :)
  5.  
  6. var st,temp:string;
  7.     i,count:byte;
  8.    
  9. Begin
  10. Write('Введите строку: '); Readln(St);
  11. Insert(#32,St,Length(St)+1);
  12.  
  13. Count:=0;
  14.  
  15. for i:=1 to Length(St) do
  16.     Begin
  17.     if (St[i] in Mn) then Temp:=Temp+St[i]
  18.                      else
  19.                          Begin
  20.                          Writeln(Temp);
  21.                          if not Odd(Length(Temp)) then Inc(Count);
  22.                          Temp:='';
  23.                          end;
  24.     end;
  25.     Writeln(Count);
  26. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement