Still not fully studied, and require a lab! Help, brother decided I do not know whether it is right.
Given a positive integer n, the symbols s1, .., sn. Obtain a sequence of characters containing only the last occurrences of each character while preserving the mutual order of these occurrences.
uses crt; const nmax=100; type u=^real; var x:array[1..nmax] of u; n,i:byte; p,s:u; begin clrscr; randomize; repeat write('Размер массива от 3 до ',nmax,' n='); readln(n); until n in [3..nmax]; writeln('Массив:'); for i:=1 to n do begin new(x[i]); x[i]^:=5*random; write(x[i]^:0:2,' '); end; writeln; writeln; new(p); p^:=x[n-1]^+x[n]^+2*x[1]^; for i:=1 to n-2 do p^:=p^*(x[i]^+x[i+1]^+2*x[n-i+1]^); write('Произведение=',p^:0:2); for i:=1 to n do dispose(x[i]); dispose(p); readln end.