Department numbers: Difference between revisions
→{{header|Fortran}}
Line 525:
4 F = 12 - (P + S) !The fire department accepts any number, but the sum must be twelve.
5 IF (F.LE.0 .OR. F.GT.7) CYCLE SS !Ensure that the only option is within range.
6 IF ((F - S)*(F - P)) 7,8,7 !And F
7 WRITE (6,"(3I2)") P,S,F !If we get here, we have a possible set.
8 END DO SS !Next S
|