fork download
  1. program TEST
  2. ! your code goes here
  3. stop
  4. end
Success #stdin #stdout 0.01s 5288KB
stdin
program hash_function
    implicit none

    character(len=50) :: str
    integer :: i, hash

    ! 学籍番号と名前を連結
    str = "202200680NishidaHiroki"

    hash = 0

    do i = 1, len_trim(str)
        hash = mod(hash * 31 + ichar(str(i:i)), 100000)
    end do

    print *, "Hash Value =", hash

end program hash_function
stdout
Standard output is empty