17-04-2014, 07:35 PM
PHP كود :
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
TDynamicSA= array of string;
function OccurrencesOfChar(const S: string; const C: char): integer;
var
i: Integer;
begin
result := 0;
for i := 1 to Length(S) do
if S[i] = C then
inc(result);
end;
var text:string;
count,Alpha:TDynamicSA;
i:Integer;
begin
Writeln('tapez votre texte ici : ') ;
read(text);
text:=UpperCase(text) ;
for i:=1 to 26 do begin
SetLength(count,i+1);
SetLength(Alpha,i+1);
count[i] :=IntToStr(OccurrencesOfChar(text,Char(64+i)));
Alpha[i]:= Char(64+i);
end;
for i:=1 to 26 do
Writeln(Alpha[i]+' : '+count[i]);
Readln;
Readln;
end.

