Heim >Backend-Entwicklung >PHP-Tutorial >php水仙花数的小例子

php水仙花数的小例子

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-25 09:12:571493Durchsuche

例子,php打印水仙花数。

  1. for($q=1;$q for($w=0;$w for($e=0;$e if($q*$q*$q + $w*$w*$w + $e*$e*$e ==
  2. 100*$q + 10*$w + $e){
  3. echo "$q $w $e "."

    ";

  4. }
  5. }
  6. }
  7. }
  8. ?>
复制代码


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn