!****************************************************
program Electric_Fields
!****************************************************
 implicit none
 integer,parameter :: P=20     !max number of charges
 real,dimension(P) :: X,Y,Q
 integer           :: N
 integer           :: i,j,draw
 real              :: x0,y0
!-------------  SET CHARGE DISTRIBUTION ----
 print *, '# Enter number of charges:'
 read  *, N
 print *, '# N= ',N
 do i=1,N
  print *,'# Charge: ',i
  print *,'# Position and charge: (X,Y,Q):'
  read  *,  X(i),Y(i),Q(i)
  print *,'# (X,Y)= ', X(i),Y(i), ' Q= ',Q(i)
 enddo
!-------------  DRAWING LINES  -------------
 print *,'# How many lines to draw? '
 read  *, draw
 do i=1,draw
  print *,'# Initial point (x0,y0): '
  read  *, x0,y0
  call  eline(x0,y0,X,Y,Q,N)
 enddo
end program Electric_Fields
