Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by DIego__ ( 19 years ago )
program macaco_prego;
{
  Autor (es): Diego Hachmann, Lucas Batistussi
  Data: 20/08/07
  Função: Dadas as coordenadas de regiões, o programa calcula a região de
          intersecção das mesmas, esta que é a melhor área para a reserva ambiental
          que abrigará o macaco-prego.
  Arquivo: mamaco.pas
}
var
x,y,u,v,i,teste,x1,y1,u1,v1,n: integer;

begin
teste:=0;
readln (n);

begin
 
     while n>0 do
     begin 
 
 	   readln (x,y,u,v);
 
 	   for i:=2 to n do
       begin
 	       readln (x1,y1,u1,v1);
 
          if x1>x then x:=x1;
 	      if y1<y then y:=y1;
 	      if u1<u then u:=u1;
 	      if v1>v then v:=v1;
 
 	   end;
     
 	   teste:= teste+1;
 
 	   writeln ('Teste ',teste);
 
	   if ((y<v) or (u<x)) then
 	      writeln ('Nenhum')
 	   else
 	       writeln (x,' ',y,' ',u,' ',v);
 		
       writeln;
 	
       readln (n);
 	
	end;
end;
  
end.

 

Revise this Paste

Your Name: Code Language: