Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

PHP #2 [16.11.18]

AngelLIves Nov 16th, 2018 (edited) 85 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2.     $n_max = 10;
  3.     $n_min = 2;
  4.     $m_min = 2;
  5.     $m_max = 10;
  6.     $p[7][5]= 2;
  7.     print '<table border = 1>';
  8.     for ( $i=$n_min; $i <= $n_max; $i++ )
  9.     {
  10.         print '<tr>';
  11.         if ($i == $n_min){
  12.             print '<td>  </td>';
  13.             for ( $j=$m_min; $j <= $m_max; $j++){
  14.                     print "<td style='font-weight: bold'>$j</td>";
  15.                 }
  16.             print "</tr><tr>";
  17.         }
  18.         for ( $j=$m_min; $j <= $m_max; $j++)
  19.         {
  20.             if ($j == $m_min){
  21.                 print "<td style='font-weight: bold'>$i</td>";
  22.             }
  23.             $n=$i*$j;
  24.             if(!isset($p[$i][$j])){
  25.                 print "<td> $n </td>";
  26.             }
  27.             else{
  28.                 $x = pow( $n, $p[$i][$j]);
  29.                 print "<td> $x </td>";
  30.             }
  31.         }
  32.         print '</tr>';
  33.        
  34.     }
  35.     print '</table>';
  36. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top