Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program esercizio5pag26;
- const
- dim=100;
- type
- tipo=array[1..dim]of integer;
- var
- V1:tipo;
- minimo,massimo:integer;
- i,N:integer;
- procedure calcolominimo(x:tipo;d:integer);
- begin
- minimo:=X[1];
- for i:=2 to d do
- begin
- if(X[i]<minimo)then
- minimo:=X[i];
- end;
- end;
- procedure calcolomassimo(Y:tipo;d:integer);
- begin
- massimo:=Y[1];
- for i:=2 to d do
- begin
- if(Y[i]>massimo)then
- massimo:=Y[i];
- end;
- end;
- begin
- repeat
- writeln('Dammi la dimensione');
- readln(N);
- until(N>0)and(n<=dim);
- for i:=1 to N do
- begin
- randomize;
- V1[i]:=random(51);
- end;
- calcolominimo(V1,N);
- writeln(minimo);
- calcolomassimo(V1,N);
- writeln(massimo);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement