c
c *** PROGRAM MATRIZ *** 12 Mai 97
c
      USE MSFLIB
      dimension a(10,10),b(10,10),c(10,10)
      integer r,coluna
c
      open(7,file='dados',form='formatted')
	open(8,file='saida',form='formatted')
c	open(9,file='user')
	open(9,file='user',title='Resultados')
	open(10,file='user',title='Dados')
c
      read(7,*) m
	read(7,*) n
	read(7,*) r
	read(7,*)
c
      write(8,11)
	write(10,11)
	do linha=1,m
	  read(7,*)  (a(linha,coluna),coluna=1,n)
	  write(8,*) (a(linha,coluna),coluna=1,n)
	  write(10,*) (a(linha,coluna),coluna=1,n)
	end do
c
      read(7,*)
	write(8,12)
	write(10,12)
	do linha=1,n
	  read(7,*)  (b(linha,coluna),coluna=1,r)
	  write(8,*) (b(linha,coluna),coluna=1,r)
	  write(10,*) (b(linha,coluna),coluna=1,r)
	end do
	read(10,*)
c
      do i = 1,m
	  do k = 1,r
	    c(i,k) = 0.0
          do j = 1,n
	      c(i,k) = a(i,j)*b(j,k) + c(i,k)
	    end do
	  end do
	end do
c
	write(8,13)
	write(9,13)
	do linha=1,m
	  write(8,*) (c(linha,coluna),coluna=1,r)
	  write(9,*) (c(linha,coluna),coluna=1,r)
	end do
	read(9,*)
c
   11 format(//,10x,'MATRIZ A',/)
   12 format(//,10x,'MATRIZ B',/)
   13 format(//,10x,'MATRIZ C = A x B',/)
c
      close(7)
      close(8)
	close(9)
	close(10)
c
      end