There are five countries whose names, when spelt out in capital letters, have no enclosed spaces within the letters.
For instance, FRANCE is not acceptable because both the R and the A have enclosed areas, while LEVIK, if it was a country, has no enclosed areas and so would be acceptable.
OPEN "cntrylst.txt" FOR INPUT AS #1
LINE INPUT #1, l$
good = 1
FOR i = 1 TO LEN(l$)
IF INSTR("ABDOPQR", MID$(l$, i, 1)) > 0 THEN good = 0: EXIT FOR
IF good THEN PRINT l$
LOOP UNTIL EOF(1)
produces a list
ST. KITTS & NEVIS
from which we can eliminate ST. KITTS & NEVIS, as, when AND is spelled out (as well as SAINT), there are letters (rather than a special character), which contain enclosed space.
Posted by Charlie
on 2007-01-16 15:21:28