Advertisement
carlos_neto

desafio-fumante.php

Jul 24th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. echo "<!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset='utf-8' />
  7. <title>Quanto gastou com cigarro?</title>
  8. </head>
  9. <body>";
  10. $idin = $_POST["idade_inicial"];
  11. $idat = $_POST["idade_atual"];
  12. $quant = $_POST["cigarros_dia"];
  13. $maco = $quant / 20;
  14. $pre = $_POST["preco_maco"];
  15. $dif = $idat - $idin;
  16.  
  17. print "<h3>Vocรช jรก gastou R$".number_format($dif*365*$maco*$pre, 2, ",", ".")." com cigarros em toda a sua vida.</h3>
  18. </body></html>";
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement