我们可以比较两个整数而不使用关系运算符

编程入门 行业动态 更新时间:2024-10-16 02:29:15
本文介绍了我们可以比较两个整数而不使用关系运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨 我们可以比较两个整数而不使用关系运算符(==!=< < =>> =) 谢谢 rajesh s

hi can we compare two integers without using relational operators (== != < <= > >=) thanks rajesh s

推荐答案

raju写道: raju wrote: hi 我们可以比较两个整数而不使用关系运算符(==!=< < =>> =) 谢谢 rajesh s hi can we compare two integers without using relational operators (== != < <= > >=) thanks rajesh s

也许你想在指针的情况下比较他们的参考文件但是 那些赢了'不要说女巫是更大的。 或者你想用面具进行比较? 如果你喜欢精确的答案,那就更准确了。

Maybe you want to compare their references in case of pointers but those won''t say you witch is the greater. Or maybe you would like to make the comparision on bits with a mask? Be more precise if you like precise answers.

raju写道: 嗨我们可以比较两个整数而不使用关系运算符(==!=< < =>> =) hi can we compare two integers without using relational operators (== != < <= > >=)

是的。

yes.

" raju" ; < RA ******** @ gmail>写道: "raju" <ra********@gmail> writes: 我们可以比较两个整数而不使用关系运算符(==!=< < =>> =) can we compare two integers without using relational operators (== != < <= > >=)

我们经常得到这样的问题。它大概是 相当于询问我可以在不使用 螺丝刀的情况下开螺丝吗?答案是肯定的:你可以使用一把锤子(但是当你完成了b $ b)或者你可以用一把钳子并用手将其拧干(但是它会变得非常繁琐)。我确定还有其他解决方案。 比较两个整数的方法是使用关系运算符。 这就是他们的'是的。 是的,有可能在不使用 关系运算符的情况下进行比较。如果你能给我们一个很好的理由,你为什么要这样做呢?我们也许可以提供帮助。如果它只是一个没有实际应用的编程挑战,那么我们中的一些人可能会对它们感兴趣。 如果这是家庭作业,你应该自己做。如果您的 教练想要使用Usenet而不是他的学生的答案, 他可以自己发布。 - Keith Thompson(The_Other_Keith) ks***@mib < http://www.ghoti / ~kst> 圣地亚哥超级计算机中心< *> < users.sdsc.edu/~kst> 我们必须做点什么。这是事情。因此,我们必须这样做。

We get this kind of question fairly frequently. It''s roughly equivalent to asking "Can I drive a screw without using a screwdriver?" The answer is yes: you can use a hammer (but neither the screw nor the wood is going to be in very good shape when you''re done), or you can use a pair of pliers and twist it in by hand (but it''s going to be *very* tedious). I''m sure there are other solutions. The way to compare two integers is to use a relational operator. That''s what they''re for. Yes, there are probably ways to do comparisons without using relational operators. If you can give us a good reason why you''d want to do such a thing, we may be able to help. If it''s just a programming challenge with no actual practical application, some of us might be interested enough to play along. And if it''s a homework assignment, you should do it yourself. If your instructor wanted answers from Usenet rather than from his students, he could have posted himself. -- Keith Thompson (The_Other_Keith) ks***@mib <www.ghoti/~kst> San Diego Supercomputer Center <*> <users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this.

更多推荐

我们可以比较两个整数而不使用关系运算符

本文发布于:2023-11-30 08:50:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649428.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我们可以   而不   整数   运算符   两个

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!