Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void cogermatriz (int matriz1[3][3]);
- void determinante (int p[3][3]);
- void normal (int pedro[3][3]);
- int main()
- {
- int a[3][3];
- cogermatriz(a);
- cout<<"la matriz es: "<<endl;
- normal (a);
- determinante(a);
- }
- void cogermatriz (int matriz1[3][3])
- {
- int i=0,j=0;
- cout<<"introduce los numeros: "<<endl;
- while(j<3){
- cout<<"************************************************************************************************************************"<<endl<<"fila "<<j+1<<endl;
- i=0;
- while(i<3){
- cin>>matriz1[j][i];
- i++;
- }
- j++;
- }
- }
- void determinante (int p[3][3])
- {
- 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]);
- }
- void normal (int pedro[3][3])
- {
- int i=0,j=0;
- while(i<3)
- {
- j=0;
- while(j<3)
- {
- cout<<pedro[i][j]<<" ";
- j++;
- }
- cout<<endl;
- i++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement