Witam. Problem polega na tym :
mam tablicę 5 elementową, następnie proszę użytkownika o podanie elementu który chce usunąć z tablicy. Nie mam pojęcia jak to zrobić. <ort>na razie</ort> kod wygląda tak :
program sortowanie;
uses crt;
var
Tab : array[1..5] of integer;
i,j,x,n,u,pom : integer;
begin
ClrScr;
writeln('Wprowadz kolejno 5 liczb calkowitych : ');
for i:=1 to 5 do
begin
writeln('Podaj liczbe ');
readln(Tab[i]);
end;
n:=5;
for i:=1 to n-1 do
for j:=1 to n-1 do
if Tab[j]>Tab[j+1] then
begin
x:=Tab[j];
Tab[j]:=Tab[j+1];
Tab[j+1]:=x;
end;
writeln;
writeln;
for i:=1 to 5 do
write(Tab[i],' ');
writeln;
write('Element najwiekszy to : '); write(Tab[5]);
writeln;
write('Element najmniejszy to : '); write(Tab[1]);
writeln;
write('Podaj element do usunięcia : ');
readln(u);
for i:=1 to 5 do
if Tab[i] = u then
begin
end;
for i:=1 to 5 do
write(Tab[i],' ');
readln;
end.
Z góry dzięki za info.
Pozdrowienia.
// Następnym razem używaj tagu <code class="delphi"></code>
- Q