1. Qiita
  2. Items
  3. Fortran90

ズンドコキヨシ with Fortran90

  • 3
    Like
  • 0
    Comment

ズンドコキヨシまとめ に触発されて、C 版 を元に Fortran90 で書いてみました。

killyoushit.f90
program killyoushit
  integer nlz, c
  nlz = 0
  c = 0
  do
    if (c .eq. 1) then
      nlz = nlz + 1
    else
      nlz = 0
    end if
    c = iand(irand(), 1)
    if (c .eq. 1) then
      print *, "ズン"
    else
      print *, "ドコ"
    end if
    if (.not. ((nlz .lt. 4) .or. (c .eq. 1))) then
      exit
    endif
  end do
  print *, "キ・ヨ・シ"
end program killyoushit
Comments Loading...