fork download
  1. VAR a:array [1..100] of longint;
  2. i,j,d:longint;
  3. BEGIN
  4. for i:=1 to 5 do
  5. read(a[i]);
  6. for i:=1 to 5-1 do
  7. begin
  8. for j:=1 to 5-i do
  9. if a[j]>a[j+1] then
  10. begin d:=a[j]; a[j]:=a[j+1]; a[j+1]:=d end;
  11. end;
  12. writeln(a[4]+a[5])
  13. END.
Success #stdin #stdout 0s 5508KB
stdin
3 1 6 10 4
stdout
16