1. Se d un text. S se calculeze numrul vocalelor din text. Program Vocale; uses crt; const vocalele=[`A`, `a`, `E`, `e`, `I`, `i`, `O`, `o`, `U`, `u`]; var st: string; i, count: integer; begin clrscr; write(`Scrie textul: `); readln(st); for i:=1 to length (st) do if st[i] in vocalele then inc(count); writeln(count); readkey; end. 2. Se d un text. S se substituie literele a cu litera o i invers. De exemplu, pentru textul program se va afia pragrom. Program Schimb; uses crt; var s: string; i, n: byte; begin clrscr; write(`Inlocuiti `); readln(s); n:=length(s); writeln(n); for i:=1 to n do if s[i]=a then s[i]:=o else if s[i]=o then s[i]:=a; writeln(Inlocuirea); write(s); readln end.
3. S d un text. S se substituie n acest text litera a prin silaba oa. De exemplu,
pentru textul capac se va afia coapoac. Program Schimb_silaba; uses crt; var s: string; i :byte; begin clrscr; writeln(Introduceti:); readln(s); for i:=length(s) downto 1 do if s[i]=a then begin insert(oa, s, i); delete(s, i+1, 1); end; write(s); readln; end. 4. Se d un text. S se calculeze numrul literelor m (mari i mici) din acest text. Program litere; uses crt; var s: string; i, n: byte; begin clrscr; write(`Scrie textul: `); readln(s); n:=0; for i:=1 to length(s) do if UpCase(s[i]=M then inc(n); write(`n= `, n); readkey; end.