Voilà un exercice de qui demande 10 nombres entiere puis qui trie ces nombres en nombres positifs et negatifs.
Exemple

Donnez 10 nombres entiere :
2 7 8 3 -5 -8 4 -1 -9 10
nombres positifs : 2 7 8 3 4 10
nombres negatifs: -5 -8 -1 -9
J'ai essayé avec ce code source mais ça ne marche pas; la compilation donne "error 113 error in statement"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
program classinegpos;
uses crt;
var
  pos, neg, nbr : array[1..10] of real;
  i, j, l     : integer;
 
begin
  clrscr;
  for i := 1 to 10 do
     begin
    writeln('entrer 10 nombre positive et negative ',i:3,':');
	readln (nbr[i]);
	 end;
  for i := 1 to 10 do
	write(nbr[i] :7);
  for i:= 1 to 10 do
     begin
	     if (nbr[i] >0) then
		  nbr[i]:= pos[j];
		  j:= j + 1;
		 else 
          nbr[i]:= neg[l];
          l:= l+1;		  
     end;
for j:= 1 to j do
writeln; write('pos[j]:7);
for l:= 1 to l do
writeln; writeln('neg[l]:7);
  readln;
end.
Ca me fais 4 jours pour arriver à ça, aidez-moi.
Et merci d'avance.