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