Cod sursa(job #1181014)

Utilizator Alex1199Alex Bercea Alex1199 Data 1 mai 2014 17:10:42
Problema Numarare triunghiuri Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.53 kb
var i, j, k, nr, n :integer;
    a:array[1..800] of integer;
    buf1:array[1..1 shl 17] of char;
begin
 assign(input,'nrtri.in');
 reset(input);
Assign(output,'nrtri.out');
 rewrite(output);
 Settextbuf(input,buf1);
  Readln(n);
   For i:=1 to n do
         read(a[i]);
 For i:=1 to n do
   For j:=i+1 to n do
     For k:=j+1 to n do
     begin
        if (a[i]+a[j]>=A[k]) and (a[k]+a[j]>=A[i]) and (a[i]+a[k]>=A[j]) then
            inc(nr);
     end;






   write(nr);
 close(input);
 close(output);
end.