Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void cogermatriz (int matriz1[3][3]);
  4. void determinante (int p[3][3]);
  5. void normal (int pedro[3][3]);
  6. int main()
  7. {
  8.  
  9. int a[3][3];
  10. cogermatriz(a);
  11. cout<<"la matriz es: "<<endl;
  12. normal (a);
  13. determinante(a);
  14.  
  15. }
  16.  
  17.  
  18.  
  19.  
  20. void cogermatriz (int matriz1[3][3])
  21. {
  22. int i=0,j=0;
  23. cout<<"introduce los numeros: "<<endl;
  24.  
  25. while(j<3){
  26. cout<<"************************************************************************************************************************"<<endl<<"fila "<<j+1<<endl;
  27. i=0;
  28. while(i<3){
  29. cin>>matriz1[j][i];
  30. i++;
  31.  
  32. }
  33. j++;
  34. }
  35. }
  36. void determinante (int p[3][3])
  37. {
  38. cout<<"el determinante es: "<<(p[0][0]*p[1][1]*p[2][2])+(p[0][1]*p[1][2]*p[2][0])+(p[1][0]*p[2][1]*p[0][2])-(p[0][2]*p[1][1]*p[2][0])-(p[2][1]*p[1][2]*p[0][0])-(p[0][1]*p[1][0]*p[2][2]);
  39.  
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. void normal (int pedro[3][3])
  53. {
  54. int i=0,j=0;
  55. while(i<3)
  56. {
  57. j=0;
  58. while(j<3)
  59. {
  60. cout<<pedro[i][j]<<" ";
  61. j++;
  62. }
  63. cout<<endl;
  64. i++;
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement