为什么存在函数的结果使用==和!=并非相反?

发布于 2025-01-29 08:04:53 字数 1401 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稀香 2025-02-05 08:04:53

让我们对您要评估的C#进行高级英语版本。

a)亲爱的c#,这里有一些数字:1,2,3,4。该集合中是否存在等于1?

的任何数字

是的

b)亲爱的c#,这里有一些数字:1,2,3,4。该集合中是否存在任何数字不等于1?

是的,


在第一种情况下,C#说是,因为1等于1。在第二种情况下,C#说是,因为2不等于1

Let's do a high-level English version of what you're asking C# to evaluate..

a) Dear C#, here are some numbers: 1,2,3,4. Does there exist any number in that set that is EQUAL to 1?

Yes

b) Dear C#, here are some numbers: 1,2,3,4. Does there exist any number in that set that is NOT EQUAL to 1?

Yes


In the first case, C# says yes because 1 is equal to 1. In the second case C# says yes because 2 is not equal to 1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文