Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program zadacha2;
- Var s,s1:string;
- i,z,r,z1,r1:integer;
- Begin
- z1:=0;
- r1:=0;
- z:=0;
- r:=0;
- write('Введите строку: ');
- readln(s);
- i:=0;
- While i<Length(s) do
- Begin
- inc(i);
- if not(s[i] in [' ',',']) then
- Begin
- if s[i]='*' then
- z:=z+1;
- if s[i]='#' then
- r:=r+1;
- End;
- if (s[i] in [' ',',']) then begin
- if z>0 then
- z1:=z1+1;
- if r>0 then
- r1:=r1+1;
- end;
- End;
- Write('Количество слов с * :',z1);
- Writeln;
- Write('Количество слов с # :',r1);
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement