Pagini recente » Cod sursa (job #2438300) | Cod sursa (job #101046) | Cod sursa (job #349674) | Cod sursa (job #578382) | Cod sursa (job #318676)
Cod sursa(job #318676)
program p1;
var f,g:text;
x:array[1..100] of integer;
i,n,a,b,c,nr,j,l:integer;
begin
assign(f,'nrtri.in');reset(f);
assign(g,'nrtri.out');rewrite(g);
read(f,n);
for i:=1 to n do read(f,x[i]);
nr:=0;
for i:=1 to n-2 do
for j:=i+1 to n-1 do
for l:=j+1 to n do
begin
a:=x[i];
b:=x[j];
c:=x[l];
if (a+b>c)and(a+c>b)and(b+c>a) then nr:=nr+1;
end;
writeln(g,nr);
close(f);
close(g);
end.