Mostrando entradas con la etiqueta trabajo de laboratorio 3. Mostrar todas las entradas
Mostrando entradas con la etiqueta trabajo de laboratorio 3. Mostrar todas las entradas

miércoles, 17 de diciembre de 2014

lab 3


//HERRERA ATUNGA MAYCON YERSON ROBELT IIME-I
#include
#include
using namespace std;

const int TAM_N=3, TAM_M=3, N=10, M=10;
int i,j,c,d,E,L,Max,Min,S,D;
int  Elemento, Matriz[TAM_N][TAM_M],A[TAM_N][TAM_M],B[TAM_N][TAM_M],min ,max;
int n, m, M1[N][M], M2[N][M];
void  sumamos (int M1[N][M], int M2[N][M], int Matriz[N][M], int n, int m);
void Visualizamos(int Matriz[N][M], int n, int m);
void entrada ();
void lectura ();
int maximo ();
int minimo ();
int suma ();
int determinante();
int main()
{
    cout<<"INGRESE n= "; cin>>n;
    cout<<"INGRESE m= "; cin>>m;
 
    Llenamos(M1, n, m);
    Llenamos(M2, n, m);
    sumamos (M1, M2, Matriz, n, m);
    Visualizamos(Matriz, n, m);
    system("PAUSE");
    return 0;
}

void Llenamos(int Matriz[N][M], int n, int m)
{
 cout<<"--------------------------------"< for(i=1;i<=n;i++)
  for(j=1;j<=m;j++)
  {
   cout<<"M["<>Matriz[i][j];
  }
}

void  sumamos (int M1[N][M], int M2[N][M], int Matriz[N][M], int n, int m)
{
 cout<<"--------------------------------"< for(i=1;i<=n;i++)
  for(j=1;j<=m;j++)
  {
   Matriz[i][j] = M1[i][j] + M2[i][j];
  }
   cout<}

void Visualizamos(int Matriz[N][M], int n, int m)
{
 cout<<"--------------------------------"< cout<<"LA SUMA DE LA MATRIZ (S = M1 + M2 ) ES:"< for(i=1;i<=n;i++)
  for(j=1;j<=m;j++)
  {
   cout<<"S["<  }

int main()

{
// 1) DECLARACION

int opcion;
do
{
cout<<"\n\n ****** MENU PRINCIPAL ******* \n\n";
cout<<"1) LEER UNA MATRIZ \n ";
cout<<"2) IMPRESION O ESCRITURA DE LA LONGITUD DEL CONDUCTOR \n ";
cout<<"3) PROCESAR LA MAXIMA LONGITUD DEL CONDUCTOR \n ";
cout<<"4) PROCESAR LA MINIMA LONGITUD DEL CONDUCTOR \n ";
cout<<"5) SUMA DE lOS ELEMENTOS DE LA MATRIZ\n ";
cout<<"6) DETERMINANTE DE UNA MATRIZ\n ";
cout<<" DIGITE <0> PARA SALIR \n\n ";
cout<<"******************************** \n\n";
cout<<"      ELIJA UNA OPCION DE LAS 6 OPCIONES DEL MENU PRINCIPAL: ";  cin>>opcion;


switch (opcion)
{
 case 1:
   {
    cout<<"\n ***************** LEER UNA MATRIZ *******************\n\n";

    for (i=1;i<=TAM_N;i++)
    for (j=1;j<=TAM_M;j++)
    {
        cout<<" INGRESE LA MATRIZ n["<> Matriz[i][j];     
    }
    cout<    cout<<" ********************************************************* \n\n";
   }//FIN DEL CASO 1
   break;

case 2:
           {
           cout<<" ****** IMPRESION O ESCRITURA DE LA LONGITUD DEL CONDUCTOR ******\n\n";
           lectura ();//LLAMADO 2
           cout<           cout<<" ************************************* \n\n";
           }
           break;
           //FIN DEL CASO 2

case 3:
           {  
           cout<<" ****** PROCESAR LA MAXIMA LONGITUD DEL CONDUCTOR ******\n\n";
           maximo ();//LLAMADO 3
           cout<           cout<<" ****************************************** \n\n";
           }
           break;
           //FIN DEL CASO 3

case 4:
           {
           cout<<" ****** PROCESAR LA MINIMA LONGITUD DEL CONDUCTOR ******\n\n";
           minimo();//LLAMADO 4
           cout<           cout<<" **************************************** \n\n";
           }
           break;
           //FIN DEL CASO 4

case 5:
           {
           cout<<" ****** SUMA DE LOS ELEMENTOS DE LA MATRIZ ******\n";
           suma();//LLAMADO 5
           cout<           cout<<" **************************************** \n\n";
           }
           break;
           //FIN DEL CASO 5

case 6:
           {
           cout<<" ****** DETERMINANTE DE UNA MATRIZ ******\n\n";
           determinante();
           cout<           cout<           cout<<" ************************************* \n\n";
           }
           break;
           //FIN DEL CASO 6

} // FIN DEL SWITCH
}
while (opcion !=0);

cout<system("pause");
return 0;
} // FIN DEL PROGRAMA

//ZONA DE DESARROLLO

                                 void entrada ()
{
        for (i=1;i<=TAM_N;i++)
        for (j=1;j<=TAM_M;j++)
        {
        cout<<" INGRESE EL ELEMENTO M["<> Matriz[i][j];
        }
}

                                void lectura ()
{
       for (i=1;i<=TAM_N;i++)
       for (j=1;j<=TAM_M;j++)
 
       cout<<" EL ELEMENTO M["< 
}

                               int maximo ()
{
       int max=0;
       for (i=1;i<=TAM_N;i++)
       for (j=1;j<=TAM_M;j++)
       {
       if(Matriz[i][j]>max)
       max = Matriz[i][j];
       }
       cout<<" EL MAXIMO DE LOS ELEMENTOS DE LA MATRIZ ES : "<
}

                             int minimo ()
{
       int min=1000000;
       for (i=1;i<=TAM_N;i++)
       for (j=1;j<=TAM_M;j++)
       {
       if(Matriz[i][j]       min = Matriz[i][j];
       }
       cout<<" EL MINIMO DE LOS ELEMENTOS DE LA MATRIZ ES : "<}

                            int suma ()
{
       int suma =0;
       for (i=1;i<=TAM_N;i++)
       for (j=1;j<=TAM_M;j++)
       suma=suma+Matriz[i][j];
       cout<<" -------------------------------------\n";
       cout<<" LA SUMA DE LOS ELEMENTOS DE LA MATRIZ ES :"<}

                            int determinante()
{
  d=((Matriz[1][1]*Matriz[2][2]*Matriz[3][3])+(Matriz[1][2]*Matriz[2][3]*Matriz[3][1])+(Matriz[1][3]*Matriz[2][1]*Matriz[3][2])-(Matriz[3][1]*Matriz[2][2]*Matriz[1][3])-(Matriz[3][2]*Matriz[2][3]*Matriz[1][1])-(Matriz[3][3]*Matriz[2][1]*Matriz[1][2]));
  cout<  cout<<" LA DETERMINANTES ES :"<}


https://drive.google.com/open?id=0BxQvxuAyictJUS14eGtrNi1xRUU&authuser=0