mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-04 03:00:06 +08:00
upgrade zig codes to 0.11.0-dev.3379+629f0d23b (#563)
* upgrade zig codes to 0.11.0-dev.3379+629f0d23b * upgrade zig codes to 0.11.0-dev.3379+629f0d23b
This commit is contained in:
@@ -28,5 +28,4 @@ pub fn main() !void {
|
||||
inc.PrintUtil.printArray(i32, &nums);
|
||||
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -160,4 +160,4 @@ pub fn main() !void {
|
||||
inc.PrintUtil.printArray(i32, &nums2);
|
||||
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ fn countingSortDigit(nums: []i32, exp: i32) !void {
|
||||
// defer mem_arena.deinit();
|
||||
const mem_allocator = mem_arena.allocator();
|
||||
var counter = try mem_allocator.alloc(usize, 10);
|
||||
std.mem.set(usize, counter, 0);
|
||||
@memset(counter, 0);
|
||||
var n = nums.len;
|
||||
// 统计 0~9 各数字的出现次数
|
||||
for (nums) |num| {
|
||||
|
||||
Reference in New Issue
Block a user