5 שיעור  

program INSORT;
var list:array[0..25] of integer;
    j,achron:0..25;
    mispar:integer;
begin
  for j:=1 to 25 do  readln(list[j]);
  list[0]:=-maxint;
  for achron:=1 to 24 do
  begin
    j:=achron;  mispar:=list[achron+1];
    while mispar < list[j] do
    begin
      list[j+1]:=list[j];  j:=j-1
    end;
    list[j+1]:=mispar
  end;
  for j:=1 to 25 do  writeln(list[j])
end.

program BUBBLE;
var chiluf:boolean;
    tmp,j:integer;
    list:array[1..25] of integer;
begin
  for j:=1 to 25 do  readln(list[j]);
  chiluf:=true;
  while chiluf do
  begin
    chiluf:=false;
    for j:=1 to 24 do
      if list[j] > list[j+1]
        then begin
          tmp:=list[j];
          list[j]:=list[j+1];
          list[j+1]:=tmp;
          chiluf:=true
        end
    end;
    for j:=1 to 25 do  writeln(list[j])
end.
--------------------------------------------------------------------------
var mark:array[1..numstudents] of array[1..numtests] of 0..100;
var mark:array[1..numstudents, 1..numtests] of 0..100;
   talmida:1..numstudents;
   behina:1..numtests;
mark[talmida]
mark[talmida,behina]
mark[2]
mark[2,4]

sum:=0;
for talmida:=1 to numstudents do
begin
  tsum:=0;
  for behina:=1 to numtests do
    tsum:=tsum + mark[talmida, behina];
  writeln('Student # ',talmida,'  Average: ',tsum/numtests);
  sum:=sum+tsum
end;
writeln;
writeln('The class average is: ',sum/(numstudents*numtests));