• Aucun résultat trouvé

tm : tab1

N/A
N/A
Protected

Academic year: 2022

Partager "tm : tab1"

Copied!
2
0
0

Texte intégral

(1)

program sujet_8h;

uses WinCrt;

type tab1 = array [1..100] of string[8];

tab2 = array [1..100] of integer;

var

n, x, i : integer;

tm : tab1;

ts : tab2;

procedure remplir(var tm : tab1 ; var ts : tab2 ; var n : integer);

var v : longint;

e, i : integer;

begin repeat

Write('Donner le nombre d''éléments [5..100] : ');

Readln(n);

until (n >= 5) and (n <= 100);

for i:=1 to n do begin

repeat

Write('Tm[',i,']= ');

Readln(tm[i]);

Val(tm[i], v, e);

until (length(tm[i]) = 8) and (e = 0);

repeat

Write('Ts[',i,']= ');

Readln(ts[i]);

until (ts[i] >= 20) and (ts[i] <= 100);

end;

end;

procedure tri(var tm : tab1 ; var ts : tab2 ; n : integer);

var i, j, aux1 : integer;

aux2 : string;

permut:boolean;

begin repeat

permut:=false;

for j:=1 to n-1 do if (ts[j+1] > ts[j]) then begin

permut:=true;

(2)

aux2 := tm[j + 1];

tm[j + 1] := tm[j];

tm[j] := aux2;

aux1 := ts[j + 1];

ts[j + 1] := ts[j];

ts[j] := aux1;

end;

until permut=false;

end;

procedure affiche(tm:tab1);

var i:integer;

begin

for i:= 1 to round(n/4) do write(tm[i],' ');

end;

begin

Remplir(tm, ts, n);

Tri(tm, ts, n);

affiche(tm);

end.

Références

Documents relatifs

Furthermore, is it legitimate to conclude that there is a feature (or parameterization) along the path in this space between the small white and large black circle.. Nothing in

● To turn off the CONTROL LOCK function, while holding the MENU button press the CHROMA/PHASE button. Then set the CONTROL LOCK function

 Entraînement 2 Complète le tableau en mettant les bons prénoms dans les bonnes cases.. La voiture de Saïd est une

¥ Entraînement 2 Complète le tableau en mettant les bons prénoms dans les bonnes cases.. La voiture de Saïd est une

The DS9091K MicroLAN Evaluation Kit provides hard- ware, software and documentation for evaluation of Dal- las Semiconductor’s 1–Wire MicroLAN technology using integrated circuits

Identical to the Forward and Reverse Drive modes except that the equipment has also been given a Fast command. The tape moves at twice the nominal drive

First, Concurrent CP/M searches for the command under the current user number on the default drive, then for a system command file under User O.. If it does

exact formatting 'is done by some macro package, and if none is supplied the references will not be printed. By default, the references are numbered