Advertisement
bulfaitelo

matiz03 sem terminar

Aug 29th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.45 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3.  
  4. <head>
  5.     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  6.     <meta name="author" content="MESMERiZE" />
  7.     <title>Projeto matrizes pg 03</title>
  8. </head>
  9.  
  10. <body>
  11. <table border="2" align="center">
  12. <?php
  13. $local = $_POST['local'];
  14. $resposta = array();
  15. $local_t = array();
  16. //vatiaveis....
  17.  
  18. $contador_coluna;
  19. $contador_linha;
  20. $contador_coluna = 0;
  21. $contador_linha = 0;
  22.  
  23.    $l = 0 ;
  24.    $c = a ;
  25.    $lt = 1;
  26.    $ct = a;
  27. ?>
  28. <table border="2">
  29. <tr>
  30.  
  31. <?php
  32.    $t = 0 ;
  33.    //soma
  34.    if ($operando =='soma')
  35.    {
  36.    $total_linhas_colunas = ($linhas*$colunas);
  37.  
  38.         for($cont=1; $cont <= $total_linhas_colunas; $cont++)
  39.         {
  40.            $l++;
  41.            //soma
  42.  
  43.                   $resposta[$t][$c][$l] = (($local[1][$c][$l]) + $local[2][$c][$l]);
  44.                   echo "<td>" . ($resposta[$t][$c][$l]) . "</td>";      
  45.            
  46.             // soma
  47.             if ($l == $colunas)
  48.             {
  49.                 echo "</tr>";
  50.                 $c++;
  51.                 $l = 0 ;
  52.             }
  53.          }
  54.      }  
  55.     //soma
  56.    
  57. //-----------------------------------------------------------------------------------------------------------    
  58.    
  59.     //adção
  60.    
  61.     if ($operando =='adicao')
  62.     {
  63.     $total_linhas_colunas = ($linhas*$colunas);
  64.  
  65.          for($cont=1; $cont <= $total_linhas_colunas; $cont++)
  66.         {
  67.            $l++;
  68.            //adção
  69.  
  70.                   $resposta[$t][$c][$l] = (($local[1][$c][$l]) - $local[2][$c][$l]);
  71.                   echo "<td>" . ($resposta[$t][$c][$l]) . "</td>";      
  72.            
  73.             //adção
  74.             if ($l == $colunas)
  75.             {
  76.                 echo "</tr>";
  77.                 $c++;
  78.                 $l = 0 ;
  79.             }
  80.          }
  81.      }
  82.    
  83.     //adção
  84.  
  85.  
  86. //-----------------------------------------------------------------------------------------------------------    
  87.    
  88. //transposta.
  89.  
  90.  
  91.   if ($operando == 'multip')
  92.   {
  93.     $total_linhas_colunas = ($linhas*$colunas);
  94.    
  95.         for($cont = 1; $cont <= $total_linhas_colunas; $cont++)
  96.        {
  97.  
  98.            $l++;
  99.            $local_t[1][$ct][$lt] = ($local[2][$c][$l]);
  100.  
  101.            print "<b> CT = " . $ct . "</b>";
  102.             print "<b> LT = " . $lt . "</b><br />";
  103.             print "<b> C = " . $c . "</b>";
  104.             print "<b> L = " . $l . "</b><br /><hr>";
  105.                        
  106.             $ct++;
  107.            
  108.             if ($l == $colunas)
  109.             {
  110.                 $l = 0;
  111.                 $ct = a;
  112.                 $c++;
  113.                 $lt++;
  114.             }
  115.         }
  116.     $l = 1 ;
  117.     $c = a ;
  118.     $ct = a;
  119.     $lt = 0;        
  120.     $cr = a;
  121.     $lr = 0;
  122.    
  123.    
  124. //transposta.
  125.  
  126.  
  127. //-----------------------------------------------------------------------------------------------------------    
  128.    
  129.    
  130.   //multiplicação.....  
  131.  
  132.     for ($cont=1; $cont <= $total_linhas_colunas; $cont++)
  133.    {
  134.        $lr ++;
  135.        while ($l<= $colunas)
  136.        {
  137.            $resposta[1][$cr][$lr] = (($local[1][$c][$l])*($local_t[1][$c][$l])+ $resposta[1][$cr][$lr]);
  138.            $l++;
  139.        }
  140.        $c++;
  141.        $l = 1;//errado
  142.        
  143.  
  144.              print "<td>" . ($resposta[1][$cr][$lr]) . "</td>";
  145.  
  146.             if($lr == $colunas)
  147.             {  
  148.                 $c = a;
  149.                 $cr++;
  150.                 $lr = 0;
  151.                 echo "</tr>";
  152.             }    
  153.     }
  154.   }    
  155.    
  156.   //multiplicação.....      
  157.    
  158. //-----------------------------------------------------------------------------------------------------------    
  159.    
  160.    
  161.  
  162.  
  163.        
  164.          
  165. ?>
  166. <!-- daqui ppra cima e definitivo -->
  167.  
  168.  
  169.  
  170. </table>
  171. <?php
  172. //mostrar vetores....
  173. if ($_POST) {
  174.    echo '<pre>';
  175.     echo htmlspecialchars(print_r($_POST, true));
  176.     echo '</pre>';
  177. } else {}
  178. ?>
  179. $resposta
  180. <?php
  181. //mostrar vetores....
  182.  
  183. if ($_POST) {
  184.    echo '<pre>';
  185.     echo htmlspecialchars(print_r($local_t, true));
  186.     echo '</pre>';
  187. } else {}
  188. ?>
  189.  
  190.  
  191. <!-- voltar a pagina inicial -->
  192. <br /><br /><br /><br /><br /><br /><br />
  193.                   <hr />
  194.                 <a href="../default.php"><b>pagina inicial</b></a>
  195.                 <hr />
  196. <!-- voltar a pagina inicial -->
  197. </body>
  198. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement