Write a program that, given two intervals, tells if one is inside the other, and computes the interval corresponding to their intersection, or tells that it is empty.
Input consists of four integer numbers , , , that represent the intervals and . Assume and .
Print ‘=’ if the intervals are equal, ‘1’
if the first is inside the second (but they are not equal),
‘2’ if the second is inside the first (but they are not
equal), or ‘?’ otherwise. Also, print “[]” if
the intersection is empty, or
“[,]”
if this is their non-empty intersection.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T12:19:07.913Z
© Jutge.org, 2006–2026.
https://jutge.org