program main
implicit none
character(len=10) :: str1='hello', str2='nihao'
integer, pointer :: result
function compare_strings(str1, str2) result(result)
character(len=*), intent(in) :: str1, str2
integer, pointer :: result
if (lgt(str1, str2)) then
result = 1
else if (llt(str1, str2)) then
result = -1
else
result = 0
end if
end function compare_strings
result= compare_strings(s1, s2)
print*,result
end program main