Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html: charset=utf-8"/>
- <title>esten ob eine Zahl eine Fibonaccizahl ist.</title>
- <link rel="stylesheet" href="pruefung.css">
- </head>
- <body>
- <div id="main">
- <h1>Ergebnis:</h1>
- <?php
- $testzahl = $_POST ["testzahl"];
- define('NUM',11);
- $a = 0;
- $b = 1;
- $c = 1;
- echo "$a $b "; // 0 1
- while ($testzahl > $b) {
- }
- for($i=1 ; $i<= NUM-2 ; $a=$b, $b=$c, $i++ )
- {
- echo $c = $a+$b;
- echo " ";
- if ($testzahl = 'NUM')
- echo "$testzahl ist eine Fibonaccizahl"
- } else {
- echo "$testzahl" ist keine Fibonazzizahl"
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement