Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. echo "<br> ****************************** <br>";
  2.  
  3. // matrices multidimensionales
  4.  
  5. //creamos matriz
  6. for($i=0;$i<10;$i++){
  7. for($j=0;$j<10;$j++){
  8. $matriz[$i][$j]=0;
  9. }
  10. }
  11.  
  12. $contador=0;
  13.  
  14. //mostramos matriz en linea
  15. for($i=0;$i<10;$i++){
  16. for($j=0;$j<10;$j++){
  17.  
  18. echo $contador."-".$matriz[$i][$j]."<br>";
  19. $contador=$contador+1;
  20. }
  21. }
  22.  
  23. echo "<br> ****************************** <br>";
  24. //mostramos matriz x*x
  25. for($i=0;$i<10;$i++){
  26. for($j=0;$j<10;$j++){
  27.  
  28. echo $matriz[$i][$j];
  29.  
  30. }
  31. echo "<br>";
  32. }
  33.  
  34. echo "<br> ****************************** <br>";
  35.  
  36. $matriz[0][0]=1;
  37. $matriz[5][1]=4;
  38. $matriz[9][0]=6;
  39.  
  40. echo "<br> ****************************** <br>";
  41.  
  42. $contador=0;
  43. for($i=0;$i<10;$i++){
  44. for($j=0;$j<10;$j++){
  45.  
  46. echo $contador++."-".$matriz[$i][$j]."<br>";
  47. }
  48. }
  49.  
  50. echo "<br> ****************************** <br>";
  51. $contador=0;
  52. //mostramos matriz x*x
  53. for($i=0;$i<10;$i++){
  54. for($j=0;$j<10;$j++){
  55.  
  56. echo $matriz[$i][$j];
  57.  
  58. }
  59. echo "<br>";
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement