RosettaCodeData/Task/Department-numbers/XBasic/department-numbers.basic

21 lines
485 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
PROGRAM "Depar/num"
DECLARE FUNCTION Entry ()
FUNCTION Entry ()
PRINT "police sanitation fire"
FOR police = 2 TO 7 STEP 2
FOR fire = 1 TO 7
IF fire = police THEN GOTO cont
sanitation = 12 - police - fire
IF sanitation = fire OR sanitation = police THEN GOTO cont
IF sanitation >= 1 AND sanitation <= 7 THEN
PRINT TAB(3); police; TAB(13); fire; TAB(22); sanitation
END IF
cont:
NEXT fire
NEXT police
END FUNCTION
END PROGRAM