If x=( x(0),...,x(m-1) ) and y=( y(0),...,y(n-1) ) are strings,
where x(i) and y(i) are letters of the alphabet,
then x is less than y if x(i)=y(i) for 0≦i<j
and x(j)<y(j) or if x(i)=y(i) for 0≦i<m and m<n.
Write an algorithm that takes two strings x , y
and returns either -1, 0, or +1 if x<y ,x=y , or x>y , respectively.
有高手能幫忙解答的嗎!? 我連題目都看得有點亂...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.117.206.69