Pagini recente » Cod sursa (job #1625227) | Cod sursa (job #2444616) | Cod sursa (job #3143821) | Cod sursa (job #850591) | Cod sursa (job #24395)
Cod sursa(job #24395)
var n,m:longint;
i,j,x,y,db,k:longint;
a:array[1..4096,1..4096] of 0..1;
f:text;
begin
assign(f,'triplete.in');
reset(f);
readln(f,n,m);
for i:=1 to m do begin
readln(f,x,y);
a[x,y]:=1;
a[y,x]:=1;
end;
close(f);
db:=0;
for i:=1 to n-1 do
for j:=i+1 to n do
if (a[i,j]=1)and(a[i+1,j]=1) then db:=db+1;
assign(f,'triplete.out');
rewrite(f);
writeln(f,db);
close(f);
end.