program NumerosDeVezes; var n, {numero de elementos do vetor} i, {indice} comp, {"comprimento" do vetor} Conta, Vezes: integer; Seq: array [1..100] of real; begin writeln ('Entre com o numero de elementos da sequencia: '); readln (n); writeln ('Entre com a sequencia de ',n,' numeros reais: '); for i:=1 to n do readln (Seq[i]); Vezes := 1; comp := n; Conta := 1; while Conta<=n do begin i := 2; while i<=comp do begin if Seq[1] = Seq[i] then begin Vezes := Vezes+1; Seq[i] := Seq[comp]; comp := comp-1; i := i-1 end; i := i+1 end; if comp>0 then begin writeln (Seq[1],' ocorre ',Vezes,' vezes'); for i:=1 to comp do Seq[i] := Seq[i+1]; comp := comp-1 end; Conta := Conta+Vezes; Vezes := 1 end end.