Home >Backend Development >PHP Tutorial >三个变量看哪位高手最小

三个变量看哪位高手最小

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:22:521012browse

三个变量看谁最小。
变量a,变量b,变量c

最后,输出变量A最小,变量B最小。或变量C最小

最后,不是取变量里面的最小的值!

------解决思路----------------------

$a = 3;<br />$b = 4;<br />$c = 2;<br /><br />if($a == min($a, $b, $c)) echo '$a 最小';<br />if($b == min($a, $b, $c)) echo '$b 最小';<br />if($c == min($a, $b, $c)) echo '$c 最小';<br />
$c 最小

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn