VETORES_2
Fortran
program VETORES
Implicit None
Integer(4)::DIM, i
Real(8), ALLOCATABLE::u(:),v(:)
Real (8)::PROD_ESC
READ (*,*) DIM
WRITE (*,*) DIM
READ(*,*) !BLANK
ALLOCATE (u(DIM),v(DIM),)
u=0.0 ; v=0.0 !zerado para eliminar resíduo númerico
!LEITURA AUTOMÁTICA
DO i=1,DIM
read (*,*) u(i),v(i)
write (*,*) u(i),v(i)
END DO
!PRODUTO ESCALAR
PROD_ESC = 0.0
DO i = 1, DIM
PROD_ESC = PROD_ESC + u(i)*v(i)
END DO
write (*,*) PROD_ESC
end program VETORES
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.