Sumatoria de matrices
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Lea dos arreglos A de 5 filas y 3 Columnas y B de 3 filas y 5 columnas</title>
<style type="text/css">
<!--
.Estilo1 {color: #0000FF}
.Estilo2 {font-family: Arial, Helvetica, sans-serif}
body {
background-image: url(BABY_LUIGI_WALLPAPER_by_linkintek06.jpg);
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="trabajo5.php">
<table width="845" border="0" align="center">
<tr>
<td width="804"><h1 align="center" class="Estilo2">Matriz A 5*3</h1>
<div align="center">
<table width="464" border="0">
<tr>
<td width="144"><span class="Estilo1">
<input type="text" name="i1" />
</span></td>
<td width="144"><span class="Estilo1">
<input type="text" name="i2" />
</span></td>
<td width="154"><span class="Estilo1">
<input type="text" name="i3" />
</span></td>
</tr>
<tr>
<td><span class="Estilo1">
<input type="text" name="i4" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="i5" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="i6" />
</span></td>
</tr>
<tr>
<td><span class="Estilo1">
<input type="text" name="i7" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="i8" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="i9" />
</span></td>
</tr>
<tr>
<td><span class="Estilo1">
<input type="text" name="i10" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="i11" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="i12" />
</span></td>
</tr>
<tr>
<td><span class="Estilo1">
<input type="text" name="i13" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="i14" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="i15" />
</span></td>
</tr>
</table>
</div>
<h1 align="center" class="Estilo2">Matriz B 3*5 </h1>
<table width="771" height="107" border="0" align="center">
<tr>
<td width="149"><span class="Estilo1">
<input type="text" name="b1" />
</span></td>
<td width="149"><span class="Estilo1">
<input type="text" name="b2" />
</span></td>
<td width="149"><span class="Estilo1">
<input type="text" name="b3" />
</span></td>
<td width="149"><span class="Estilo1">
<input type="text" name="b4" />
</span></td>
<td width="153"><span class="Estilo1">
<input type="text" name="b5" />
</span></td>
</tr>
<tr>
<td><span class="Estilo1">
<input type="text" name="b6" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="b7" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="b8" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="b9" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="b10" />
</span></td>
</tr>
<tr>
<td><span class="Estilo1">
<input type="text" name="b11" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="b12" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="b13" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="b14" />
</span></td>
<td><span class="Estilo1">
<input type="text" name="b15" />
</span></td>
</tr>
</table>
<p align="center" class="Estilo2"> </p>
<p align="center"><label>
<input type="submit" name="Submit" value="Enviar" />
</label></p>
<p align="center">
<label></label>
</p>
</td>
</tr>
</table>
</form>
</body>
</html>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
<style type="text/css">
<!--
body {
background-image: url(../WP_YoshiMain_1280x1024_001.jpg);
}
.Estilo1 {font-family: "Comic Sans MS"}
-->
</style></head>
<body>
<?php
$arreglo = array(array($_POST[i1],$_POST[i2],$_POST[i3]),array($_POST[i4],$_POST[i5],$_POST[i6]),array($_POST[i7],$_POST[i8],$_POST[i9]),array($_POST[i10],$_POST[i11],$_POST[i12]),array($_POST[i13],$_POST[i14],$_POST[i15]));
echo "<h4 align=center class=Estilo1><span class=Estilo3> Matriz A</span></h4>";
?>
<table width="400" border="1" align="center" bordercolor="#009900">
<?php
echo "<tr>";
for($i=0;$i<5;$i++){
for($j=0;$j<3;$j++){
echo "<td>",$arreglo[$i][$j],"</td>";
}
echo "<tr>";
}
?></table>
<?php
$arreglo2 = array(array($_POST[b1],$_POST[b2],$_POST[b3],$_POST[b4],$_POST[b5]),array($_POST[b6],$_POST[b7],$_POST[b8],$_POST[b9],$_POST[b10]),array($_POST[b11],$_POST[b12],$_POST[b13],$_POST[b14],$_POST[b15]));
echo "<h4 align=center class=Estilo1><span class=Estilo3> Matriz B</span></h4>";
?>
<table width="400" border="1" align="center" bordercolor="#009900">
<?php
echo "<tr>";
for($i=0;$i<3;$i++){
for($j=0;$j<5;$j++){
echo "<td>",$arreglo2[$i][$j],"</td>";
}
echo "<tr>";
}
?>
</table>
<table width="200" border="3" align="center" bordercolor="#006600">
<tr>
<td><h4 align="center" class="Estilo1"><span class="Estilo3">Sumatoria de la Matriz A</span></h4></td>
<td><h4 align="center" class="Estilo1"><span class="Estilo3">Sumatoria de la Matriz B</span> </h4></td>
<td><h4 align="center" class="Estilo1"><span class="Estilo3">La matriz con Mayor Sumatoria</span> </h4></td>
</tr>
<tr>
<td><?php $_POST[SumaA] = ($_POST[i1] + $_POST[i2]+$_POST[i3] +$_POST[i4] +$_POST[i5] +$_POST[i6] +$_POST[i7] +$_POST[i8] +$_POST[i9] +$_POST[i10] +$_POST[i11] +$_POST[i12] +$_POST[i13] +$_POST[i14] +$_POST[i15]);
echo "<br/>";
echo "<br/>";
echo $_POST[SumaA];?></td>
<td><?php $_POST[SumaB] = ($_POST[b1] + $_POST[b2]+$_POST[b3] +$_POST[b4] +$_POST[b5] +$_POST[b6] +$_POST[b7] +$_POST[b8] +$_POST[b9] +$_POST[b10] +$_POST[b11] +$_POST[b12] +$_POST[b13] +$_POST[b14] +$_POST[b15]);
echo "<br/>";
echo "<br/>";
echo $_POST[SumaB];?></td>
<td> <?php
if ($_POST[SumaA] > $_POST[SumaB]) {
print "La sumatoria de Matriz A es mayor que lasumatoria matriz B";
} elseif ($_POST[SumaA] == $_POST[SumaB]) {
print "La sumatoria de Matriz A es IGUAL que la sumatoria matriz B";
} else {
print "La sumatoria de Matriz B es mayor que la matriz A";
}
?></td>
</tr>
</table>
<table width="769" height="92" border="0" align="center">
<tr>
<td><table width="117" height="122" border="3" align="center" bordercolor="#003300">
<tr>
<td width="35"><h3 class="Estilo1">
<?php $_POST[c1] = ($_POST[i1]*$_POST[b1]+ $_POST[i2]*$_POST[b6] +$_POST[i3]*$_POST[b11]); echo $_POST[c1]; ?>
</h3></td>
<td width="32"><h3 class="Estilo1">
<?php $_POST[c2] = ($_POST[i1]*$_POST[b2]+ $_POST[i2]*$_POST[b7] +$_POST[i3]*$_POST[b12]); echo $_POST[c2]; ?>
</h3></td>
<td width="28"><h3 class="Estilo1">
<?php $_POST[c3] = ($_POST[i1]*$_POST[b3]+ $_POST[i2]*$_POST[b8] +$_POST[i3]*$_POST[b13]); echo $_POST[c3]; ?>
</h3></td>
<td width="28"><h3 class="Estilo1">
<?php $_POST[c4] = ($_POST[i1]*$_POST[b4]+ $_POST[i2]*$_POST[b9] +$_POST[i3]*$_POST[b14]); echo $_POST[c4]; ?>
</h3></td>
<td width="43"><h3 class="Estilo1">
<?php $_POST[c5] = ($_POST[i1]*$_POST[b5]+ $_POST[i2]*$_POST[b10] +$_POST[i3]*$_POST[b115]); echo $_POST[c5]; ?>
</h3></td>
</tr>
<tr>
<td><h3 class="Estilo1">
<?php $_POST[c6] = ($_POST[i4]*$_POST[b1]+ $_POST[i5]*$_POST[b6] +$_POST[i6]*$_POST[b11]); echo $_POST[c6]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c7] = ($_POST[i4]*$_POST[b2]+ $_POST[i5]*$_POST[b7] +$_POST[i6]*$_POST[b12]); echo $_POST[c7]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c8] = ($_POST[i4]*$_POST[b3]+ $_POST[i5]*$_POST[b8] +$_POST[i6]*$_POST[b113]); echo $_POST[c8]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c9] = ($_POST[i4]*$_POST[b4]+ $_POST[i5]*$_POST[b9] +$_POST[i6]*$_POST[b14]); echo $_POST[c9]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c10] = ($_POST[i4]*$_POST[b5]+ $_POST[i5]*$_POST[b10] +$_POST[i6]*$_POST[b15]); echo $_POST[c10]; ?>
</h3></td>
</tr>
<tr>
<td><h3 class="Estilo1">
<?php $_POST[c11] = ($_POST[i7]*$_POST[b1]+ $_POST[i8]*$_POST[b6] +$_POST[i9]*$_POST[b11]); echo $_POST[c11]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c12] = ($_POST[i7]*$_POST[b2]+ $_POST[i8]*$_POST[b7] +$_POST[i9]*$_POST[b12]); echo $_POST[c12]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c12] = ($_POST[i7]*$_POST[b3]+ $_POST[i8]*$_POST[b8] +$_POST[i9]*$_POST[b13]); echo $_POST[c12]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c13] = ($_POST[i7]*$_POST[b4]+ $_POST[i8]*$_POST[b9] +$_POST[i9]*$_POST[b14]); echo $_POST[c13]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c14] = ($_POST[i7]*$_POST[b5]+ $_POST[i8]*$_POST[b10] +$_POST[i9]*$_POST[b15]); echo $_POST[c14]; ?>
</h3></td>
</tr>
<tr>
<td><h3 class="Estilo1">
<?php $_POST[c15] = ($_POST[i10]*$_POST[b1]+ $_POST[i11]*$_POST[b6] +$_POST[i12]*$_POST[b11]); echo $_POST[c15]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c16] = ($_POST[i10]*$_POST[b2]+ $_POST[i11]*$_POST[b7] +$_POST[i12]*$_POST[b12]); echo $_POST[c16]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c17] = ($_POST[i10]*$_POST[b3]+ $_POST[i11]*$_POST[b8] +$_POST[i12]*$_POST[b13]); echo $_POST[c17]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c18] = ($_POST[i10]*$_POST[b4]+ $_POST[i11]*$_POST[b9] +$_POST[i12]*$_POST[b14]); echo $_POST[c18]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c19] = ($_POST[i10]*$_POST[b5]+ $_POST[i11]*$_POST[b10] +$_POST[i12]*$_POST[b15]); echo $_POST[c19]; ?>
</h3></td>
</tr>
<tr>
<td><h3 class="Estilo1">
<?php $_POST[c20] = ($_POST[i13]*$_POST[b1]+ $_POST[i14]*$_POST[b6] +$_POST[i15]*$_POST[b11]); echo $_POST[c20]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c21] = ($_POST[i13]*$_POST[b2]+ $_POST[i14]*$_POST[b7] +$_POST[i15]*$_POST[b12]); echo $_POST[c21]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c22] = ($_POST[i13]*$_POST[b3]+ $_POST[i14]*$_POST[b8] +$_POST[i15]*$_POST[b13]); echo $_POST[c22]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c24] = ($_POST[i13]*$_POST[b4]+ $_POST[i14]*$_POST[b9] +$_POST[i15]*$_POST[b14]); echo $_POST[c24]; ?>
</h3></td>
<td><h3 class="Estilo1">
<?php $_POST[c25] = ($_POST[i13]*$_POST[b5]+ $_POST[i14]*$_POST[b10] +$_POST[i15]*$_POST[b15]); echo $_POST[c25]; ?>
</h3></td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
<p><a href="index.php"><<Regrezar</a> </p>
</body>
</html>
Aplicacion hecha en Macromedia Dreamwaver
lenguaje:php y html
descripcion:imprime dos matrices
hace su sumatoria y su multiplicacion
Comentarios
Publicar un comentario