用LeetCode编译报错Char 5: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]
是因为在某些情况下没有返回值
在最后添加一个return即可。
用LeetCode编译报错Char 5: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]
是因为在某些情况下没有返回值
在最后添加一个return即可。