Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html: charset=utf-8"/>
  4. <title>esten ob eine Zahl eine Fibonaccizahl ist.</title>
  5. <link rel="stylesheet" href="pruefung.css">
  6.  
  7. </head>
  8.  
  9. <body>
  10.  
  11. <div id="main">
  12. <h1>Ergebnis:</h1>
  13.  
  14. <?php
  15.  
  16. $testzahl = $_POST ["testzahl"];
  17.  
  18. define('NUM',11);
  19. $a = 0;
  20. $b = 1;
  21. $c = 1;
  22.  
  23. echo "$a $b "; // 0 1
  24. while ($testzahl > $b) {
  25.  
  26. }
  27. for($i=1 ; $i<= NUM-2 ; $a=$b, $b=$c, $i++ )
  28. {
  29. echo $c = $a+$b;
  30. echo " ";
  31.  
  32. if ($testzahl = 'NUM')
  33. echo "$testzahl ist eine Fibonaccizahl"
  34. } else {
  35. echo "$testzahl" ist keine Fibonazzizahl"
  36. ?>
  37.  
  38. </div>
  39.  
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement