mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-04 03:00:06 +08:00
Update the coding style for Zig (#336)
* Update the coding style for Zig * Update array.rs
This commit is contained in:
@@ -112,7 +112,6 @@ pub fn main() !void {
|
||||
var index = find(nums, 3);
|
||||
std.debug.print("\n在 nums 中查找元素 3 ,得到索引 = {}\n", .{index});
|
||||
|
||||
const getchar = try std.io.getStdIn().reader().readByte();
|
||||
_ = getchar;
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,5 @@ pub fn main() !void {
|
||||
var index = find(&n0, 2);
|
||||
std.debug.print("链表中值为 2 的结点的索引 = {}\n", .{index});
|
||||
|
||||
const getchar = try std.io.getStdIn().reader().readByte();
|
||||
_ = getchar;
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
@@ -74,7 +74,6 @@ pub fn main() !void {
|
||||
std.debug.print("\n排序列表后 list = ", .{});
|
||||
inc.PrintUtil.printList(i32, list);
|
||||
|
||||
const getchar = try std.io.getStdIn().reader().readByte();
|
||||
_ = getchar;
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ const std = @import("std");
|
||||
const inc = @import("include");
|
||||
|
||||
// 列表类简易实现
|
||||
// 编译期泛型
|
||||
pub fn MyList(comptime T: type) type {
|
||||
return struct {
|
||||
const Self = @This();
|
||||
@@ -171,7 +170,6 @@ pub fn main() !void {
|
||||
inc.PrintUtil.printArray(i32, try list.toArray());
|
||||
std.debug.print(" ,容量 = {} ,长度 = {}\n", .{list.capacity(), list.size()});
|
||||
|
||||
const getchar = try std.io.getStdIn().reader().readByte();
|
||||
_ = getchar;
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user