唯一的字符代码在 Linux 中运行时不起作用,但在 Windows (C++) 中很好

Unique character code not working when ran in linux but fine in windows (C++)

本文关键字:Windows 但在 C++ 很好 运行时 字符 代码 唯一 Linux 不起作用      更新时间:2023-10-16

当我在窗口中运行代码时,它按预期工作。 但是当我在 Linux 中运行它时,程序没有按预期运行并产生完全不同的输出。

我假设这是all_unique_letters方法中的一个问题,但我似乎无法弄清楚。

bool all_unique_letters(const string &s)中,unsigned int v; 在没有初始化的情况下使用。如果它包含其他0的东西,该函数将一个字母报告为重复的,而它不是。

相关文章: