Department numbers: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,962: | Line 1,962: | ||
6 4 2 |
6 4 2 |
||
6 5 1 </pre> |
6 5 1 </pre> |
||
=={{header|FutureBasic}}== |
|||
<syntaxhighlight lang="futurebasic"> |
|||
include "NSLog.incl" |
|||
void local fn DepartmentNumbers |
|||
long police, sanitation, fire |
|||
printf @"Police Sanitation Fire" |
|||
printf @"-------------------------------" |
|||
for police = 2 to 7 step 2 |
|||
for fire = 1 to 7 |
|||
if ( fire = police ) then continue |
|||
sanitation = 12 - police - fire |
|||
if ( sanitation == fire ) or ( sanitation == police ) then continue |
|||
if ( sanitation >= 1 ) and ( sanitation <= 7 ) |
|||
printf @"%4d%12d%13d", police, fire, sanitation |
|||
end if |
|||
next |
|||
next |
|||
end fn |
|||
window 1 |
|||
fn DepartmentNumbers |
|||
HandleEvents |
|||
</syntaxhighlight> |
|||
{{output}} |
|||
<pre> |
|||
Police Sanitation Fire |
|||
------------------------------- |
|||
2 3 7 |
|||
2 4 6 |
|||
2 6 4 |
|||
2 7 3 |
|||
4 1 7 |
|||
4 2 6 |
|||
4 3 5 |
|||
4 5 3 |
|||
4 6 2 |
|||
4 7 1 |
|||
6 1 5 |
|||
6 2 4 |
|||
6 4 2 |
|||
6 5 1 |
|||
</pre> |
|||
=={{header|Gambas}}== |
=={{header|Gambas}}== |