三个数字中最大的一个

编程入门 行业动态 更新时间:2024-10-10 01:27:26
本文介绍了三个数字中最大的一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在不使用任何比较的情况下找到最大的三个数字 运算符或三元运算符??

How to find the greatest of three numbers without using any comparison operator or ternary operator??

推荐答案

" Amar Kumar Dubedy" < ad ***** @ yahoo.co.inwrote in message news:11 ********************** @ e9g2000prf.googlegro ups ... "Amar Kumar Dubedy" <ad*****@yahoo.co.inwrote in message news:11**********************@e9g2000prf.googlegro ups... 如何在不使用任何比较的情况下找到最大的三个数字 运算符或三元运算符? ? How to find the greatest of three numbers without using any comparison operator or ternary operator??

如果数字是正整数 如果b大于a,则a / b为零。 C允许比较为零,所以如果(a / b)相当于if(ba) ,你可以围绕它建立第一个刺。 - 免费游戏和编程好东西。 www.personal.leeds.ac.uk/~bgy1mm

Amar Kumar Dubedy写道,在01/07/07 07:36: Amar Kumar Dubedy wrote, On 01/07/07 07:36: 如何找到最大的没有使用任何比较的三个数字 运算符或ternar y操作员? How to find the greatest of three numbers without using any comparison operator or ternary operator??

将它们全部放入戒指,扔进武器,然后等待查看哪一个 活着出来。 如果是家庭作业,自己动手,如果你做了一些愚蠢的测验,那就自己做吧。如果你在这里发布一个尝试,人们*可能会帮忙,但是为什么我们应该为你做这个? - Flash Gordon

Put them all in a ring, throw weapons in, and wait to see which one comes out alive. If it is homework, do it yourself, if you are doing some stupid quiz, do it yourself. People *might* help if you post an attempt here, but why should we do it for you? -- Flash Gordon

Amar Kumar Dubedy说: Amar Kumar Dubedy said: 如何在不使用任何比较的情况下找到最大的三个数字 运算符或三元运算符?? How to find the greatest of three numbers without using any comparison operator or ternary operator??

确保其中一个数字是LDBL_MAX,并且只需从求解函数返回LDBL_MAX 。这样,你根本不需要任何 的运营商。 - Richard Heathfield< ; http://www.cpax.uk> 电子邮件:-www。 + rjh @ 谷歌用户:< www.cpax.uk/prg/writings/googly.php> Usenet是一个奇怪的放置" - dmr 1999年7月29日

Ensure that one of the numbers is LDBL_MAX, and simply return LDBL_MAX from your solving function. That way, you don''t need any operators of any kind at all. -- Richard Heathfield <www.cpax.uk> Email: -www. +rjh@ Google users: <www.cpax.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999

更多推荐

三个数字中最大的一个

本文发布于:2023-11-29 09:57:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646070.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数字

发布评论

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

>www.elefans.com

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