Department numbers: Difference between revisions

m
→‎{{header|Zig}}: writer.print() is void (no return)
m (→‎{{header|Zig}}: writer.print() is void (no return))
Line 4,887:
const stdout = std.io.getStdOut().writer();
 
_ = try stdout.writeAll("Police Sanitation Fire\n");
_ = try stdout.writeAll("------ ---------- ----\n");
 
var p: usize = 2;
Line 4,895:
for (1..7 + 1) |f|
if (p != s and s != f and f != p and p + f + s == 12) {
_ = try stdout.print(" {d} {d} {d}\n", .{ p, s, f });
};
}</syntaxhighlight>
Line 4,921:
const stdout = std.io.getStdOut().writer();
 
_ = try stdout.writeAll("Police Sanitation Fire\n");
_ = try stdout.writeAll("------ ---------- ----\n");
 
var it = SolutionIterator{};
while (it.next()) |solution| {
_ = try stdout.print(
" {d} {d} {d}\n",
.{ solution.police, solution.sanitation, solution.fire },
59

edits