Each string will have two strings (string A and string B), each sub-string has 5 characters.
Write a program with a function compare(string A, string B) for comparison
輸入兩個字串(string A, string B), 每個字串有五個字元
寫一個compare(string A, string B)函數。不能用字串函式庫
If String A == String B returns 0
If string A> string B returns 1
If string A <string B returns -1
Do not use string libraries
Example input:
gamesbegin
Example output: (because g>b => 1)
1
Example input:
iamigiates
Example output: (because m<t => -1)
-1
Example input:
111qq111qq
Example output:
0
Remember: You may correct the cases, but your code always be revised!