All pastes #748065 Raw Edit

Mine

public text v1 · immutable
#748065 ·published 2007-10-24 15:39 UTC
rendered paste body
Matriz& Matriz::operator=(const Matriz& b){
   
    if((fil != b.fil) || (col != b.col))
        cout << "Las dimensiones son incorrectas" << endl;
    else{
         int i = 0;
         int j;
         while(i < fil){
             j = 0;
             while(j < col){
                  matriz[i][j] = b.matriz[i][j];
             j++;
             }
         i++;             
    
         }
         
        
    return *this;    
    
    }
    
}
void Matriz::multiplicar(Matriz& b, Matriz& c){
        
       
       if(col != b.fil)
          cout << "Las dimensiones son incorrectas" << endl;
       else{
            
            int i = 0;
            int j; 
            int k;
            while(i < fil){
                 j = 0;  
                while(j < b.col){
                    k = 0;     
                    long double suma = 0;
                         
                    while(k < col){
                        suma = suma + (matriz[i][k] * b.matriz[k][j]);
                        k++;
                    }         
                       
                    c.matriz[i][j] = suma;
                        
                    j++;
               }
                 i++;   
         }
   
      }
}