21 lines
489 B
Zig
21 lines
489 B
Zig
const std = @import("std");
|
|
|
|
pub fn main() void {
|
|
const input = @embedFile("input");
|
|
var iter = std.mem.split(u8, input, "\n");
|
|
|
|
var max: usize = 0;
|
|
var curr: usize = 0;
|
|
while (iter.next()) |value| {
|
|
// If not a number, we assume EOF was reached (End Of elF)
|
|
curr += std.fmt.parseInt(usize, value, 10) catch {
|
|
if (curr > max) max = curr;
|
|
|
|
curr = 0;
|
|
continue;
|
|
};
|
|
}
|
|
|
|
std.debug.print("{d}\n", .{max});
|
|
}
|