Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
- <meta name="author" content="MESMERiZE" />
- <title>Projeto matrizes pg 03</title>
- </head>
- <body>
- <table border="2" align="center">
- <?php
- $local = $_POST['local'];
- $resposta = array();
- $local_t = array();
- //vatiaveis....
- $contador_coluna;
- $contador_linha;
- $contador_coluna = 0;
- $contador_linha = 0;
- $l = 0 ;
- $c = a ;
- $lt = 1;
- $ct = a;
- ?>
- <table border="2">
- <tr>
- <?php
- $t = 0 ;
- //soma
- if ($operando =='soma')
- {
- $total_linhas_colunas = ($linhas*$colunas);
- for($cont=1; $cont <= $total_linhas_colunas; $cont++)
- {
- $l++;
- //soma
- $resposta[$t][$c][$l] = (($local[1][$c][$l]) + $local[2][$c][$l]);
- echo "<td>" . ($resposta[$t][$c][$l]) . "</td>";
- // soma
- if ($l == $colunas)
- {
- echo "</tr>";
- $c++;
- $l = 0 ;
- }
- }
- }
- //soma
- //-----------------------------------------------------------------------------------------------------------
- //adção
- if ($operando =='adicao')
- {
- $total_linhas_colunas = ($linhas*$colunas);
- for($cont=1; $cont <= $total_linhas_colunas; $cont++)
- {
- $l++;
- //adção
- $resposta[$t][$c][$l] = (($local[1][$c][$l]) - $local[2][$c][$l]);
- echo "<td>" . ($resposta[$t][$c][$l]) . "</td>";
- //adção
- if ($l == $colunas)
- {
- echo "</tr>";
- $c++;
- $l = 0 ;
- }
- }
- }
- //adção
- //-----------------------------------------------------------------------------------------------------------
- //transposta.
- if ($operando == 'multip')
- {
- $total_linhas_colunas = ($linhas*$colunas);
- for($cont = 1; $cont <= $total_linhas_colunas; $cont++)
- {
- $l++;
- $local_t[1][$ct][$lt] = ($local[2][$c][$l]);
- print "<b> CT = " . $ct . "</b>";
- print "<b> LT = " . $lt . "</b><br />";
- print "<b> C = " . $c . "</b>";
- print "<b> L = " . $l . "</b><br /><hr>";
- $ct++;
- if ($l == $colunas)
- {
- $l = 0;
- $ct = a;
- $c++;
- $lt++;
- }
- }
- $l = 1 ;
- $c = a ;
- $ct = a;
- $lt = 0;
- $cr = a;
- $lr = 0;
- //transposta.
- //-----------------------------------------------------------------------------------------------------------
- //multiplicação.....
- for ($cont=1; $cont <= $total_linhas_colunas; $cont++)
- {
- $lr ++;
- while ($l<= $colunas)
- {
- $resposta[1][$cr][$lr] = (($local[1][$c][$l])*($local_t[1][$c][$l])+ $resposta[1][$cr][$lr]);
- $l++;
- }
- $c++;
- $l = 1;//errado
- print "<td>" . ($resposta[1][$cr][$lr]) . "</td>";
- if($lr == $colunas)
- {
- $c = a;
- $cr++;
- $lr = 0;
- echo "</tr>";
- }
- }
- }
- //multiplicação.....
- //-----------------------------------------------------------------------------------------------------------
- ?>
- <!-- daqui ppra cima e definitivo -->
- </table>
- <?php
- //mostrar vetores....
- if ($_POST) {
- echo '<pre>';
- echo htmlspecialchars(print_r($_POST, true));
- echo '</pre>';
- } else {}
- ?>
- $resposta
- <?php
- //mostrar vetores....
- if ($_POST) {
- echo '<pre>';
- echo htmlspecialchars(print_r($local_t, true));
- echo '</pre>';
- } else {}
- ?>
- <!-- voltar a pagina inicial -->
- <br /><br /><br /><br /><br /><br /><br />
- <hr />
- <a href="../default.php"><b>pagina inicial</b></a>
- <hr />
- <!-- voltar a pagina inicial -->
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement