Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Programarea calculatoarelor. Aplicaţii în limbajul PASCAL

# Programarea calculatoarelor. Aplicaţii în limbajul PASCAL

Ratings:

5.0

(1)
|Views: 1,758|Likes:

Published by: Cătălin on May 05, 2009

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

05/11/2014

pdf

text

original

Cuprins
1. Lucrul cu masive memorate \u00een zona HEAP.......................................................
3
2. Implementarea structurii de list\u0103 \u00een limbajul Pascal...................................
11
3. Grafuri. Implement\u0103ri \u00een limbajul Pascal........................................................
39
4. Arbori......................................................................................................................
48
5. Algoritmi recursivi. Metodele divide et impera\u015fibacktracking............
54
6. Reprezentarea vizual\u0103 a datelor.......................................................................
75
7. Obiecte \u00een Pascal..................................................................................................
87
Bibliografie................................................................................................................. 100
1. LUCRUL CU MASIVE MEMORATE
\u00ceN ZONA HEAP
Problema 1. Fiex un vector de numere reale, preluat de la tastatur\u0103 \u015fi
memorat dinamic. Scrie\u0163i programul Pascal pentru sortarea luix.
uses crt;

type
vector=array[1..100] of real;
pvect=^vector;

varx:pvect;
i,j,n:byte;
aux:real;

begin
clrscr;
write('Dimensiunea:');
new(x);
writeln('Elementele vectorului:');
for i:=1 to n do

begin
write('x[',i,']=');
end;

for i:=1 to n-1 do
for j:=i+1 to n do

if x^[i]>x^[j] then
begin
aux:=x^[i];
x^[i]:=x^[j];
x^[j]:=aux;
end;

writeln('Vectorul sortat');
for i:=1 to n do
write(x^[i]:7:2,' ');

dispose(x);
end.

3

## Activity (29)

You've already reviewed this. Edit your review.