Advertisement
Oppaceted

OiU_2

Jun 2nd, 2023
1,045
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program main
  2.     implicit none
  3.     real(8),parameter :: pi = 3.1415926535897932384626433832795
  4.     ! number in list
  5.     integer, parameter :: i = 10
  6.     integer :: p,s
  7.     do while (.true.)
  8.         write (0,fmt = '(a$)') 'Enter p: '
  9.         read (*,*) p
  10.         write (0,fmt = '(a$)') 'Enter s: '
  11.         read (*,*) s
  12.         if ( (s <= 0) .or. (p <= 0) ) then
  13.             exit
  14.         end if
  15.         write (0,fmt = '(a,i1,a,i1,a,f3.0,/)') &
  16.         'Cost a road from: ',p,' to ',s,' : ', aint( 6.0d0 + cos( pi/15*(i + 4*p + s ) )*5.0d0  )
  17.     end do
  18. end program
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement