33 lines
1.4 KiB
Plaintext
33 lines
1.4 KiB
Plaintext
100 cls
|
|
110 print "Los apartamentos están numerados del 0 (bajo) al 4 (ático)."
|
|
120 print "Baker, Cooper, Fletcher, Miller y Smith viven en apartamentos diferentes."
|
|
130 print "- Baker no vive en el último apartamento (ático)."
|
|
140 print "- Cooper no vive en el piso inferior (bajo)."
|
|
150 print "- Fletcher no vive ni en el ático ni en el bajo."
|
|
160 print "- Miller vive en un apartamento más alto que Cooper."
|
|
170 print "- Smith no vive en un apartamento adyacente al de Fletcher."
|
|
180 print "- Fletcher no vive en un apartamento adyacente al de Cooper."
|
|
190 print
|
|
200 for baker = 0 to 3
|
|
210 for cooper = 1 to 4
|
|
220 for fletcher = 1 to 3
|
|
230 for miller = 0 to 4
|
|
240 for smith = 0 to 4
|
|
250 if baker <> cooper and baker <> fletcher and baker <> miller and baker <> smith and cooper <> fletcher then
|
|
260 if cooper <> miller and cooper <> smith and fletcher <> miller and fletcher <> smith and miller <> smith then
|
|
270 if miller > cooper and abs(smith-fletcher) <> 1 and abs(fletcher-cooper) <> 1 then
|
|
280 print "Baker vive en el piso ";baker
|
|
290 print "Cooper vive en el piso ";cooper
|
|
300 print "Fletcher vive en el piso ";fletcher
|
|
310 print "Miller vive en el piso ";miller
|
|
320 print "Smith vive en el piso ";smith
|
|
330 endif
|
|
340 endif
|
|
350 endif
|
|
360 next smith
|
|
370 next miller
|
|
380 next fletcher
|
|
390 next cooper
|
|
400 next baker
|
|
410 end
|