Run Zig 0.13 / 0.14 online — no hidden control flow, no macros, real speed.
Zig is Andrew Kelley's take on a modern systems language: no hidden control flow, no macros, first-class error unions, and a comptime that replaces both templates and macros. Popular as a modern alternative to C.
ls-judge compiles Zig 0.13 and 0.14 inside a Firecracker microVM.
Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.
const std = @import("std");
pub fn main() !void {
const stdin = std.io.getStdIn().reader();
const stdout = std.io.getStdOut().writer();
var buf: [64]u8 = undefined;
const line = try stdin.readUntilDelimiter(&buf, '\n');
const n = try std.fmt.parseInt(i64, std.mem.trim(u8, line, &std.ascii.whitespace), 10);
try stdout.print("{d}\n", .{n * 2});
}
21
42