Advertisement
Oppaceted

Untitled

Mar 22nd, 2023
986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Solution
  2.   implicit none
  3. contains
  4.   pure function numMags(weapon, numberOfStreets)
  5.     character(*), intent(in) :: weapon
  6.     integer, intent(in) :: numberOfStreets
  7.     integer :: numMags, bullets_in_mag
  8.     numMags = 0 ! TODO
  9.     select case (weapon)
  10.     case ('PT92')
  11.     bullets_in_mag = 17
  12.     case ('M4A1')
  13.     bullets_in_mag = 30
  14.     case ('M16A2')
  15.     bullets_in_mag = 30
  16.     case ('PT92')
  17.     bullets_in_mag = 5
  18.     end select
  19.     do while (bullets_in_mag*numMags<numberOfStreets*3)
  20.     numMags = numMags + 1
  21.     end do
  22.   end function numMags
  23. end module Solution
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement