diff --git a/codes/zig/chapter_computational_complexity/time_complexity.zig b/codes/zig/chapter_computational_complexity/time_complexity.zig index 3b45ed79f..40f609459 100644 --- a/codes/zig/chapter_computational_complexity/time_complexity.zig +++ b/codes/zig/chapter_computational_complexity/time_complexity.zig @@ -140,7 +140,7 @@ fn factorialRecur(n: i32) i32 { } // Driver Code -pub fn main() void { +pub fn main() !void { // 查看本地CPU架构和操作系统信息 var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{}); std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag}); diff --git a/codes/zig/chapter_computational_complexity/worst_best_time_complexity.zig b/codes/zig/chapter_computational_complexity/worst_best_time_complexity.zig index 42961aafb..f9fcd2f67 100644 --- a/codes/zig/chapter_computational_complexity/worst_best_time_complexity.zig +++ b/codes/zig/chapter_computational_complexity/worst_best_time_complexity.zig @@ -27,7 +27,7 @@ pub fn findOne(nums: []i32) i32 { } // Driver Code -pub fn main() void { +pub fn main() !void { // 查看本地CPU架构和操作系统信息 var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{}); std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag});