Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Tran Viet Anh - 9:43PM
- int compare(string x, string y)
- {
- if (x.length() > y.length()) return 1;
- else
- if (x.length() < y.length()) return -1;
- else
- {
- for (int i = 0; i < x.length(); i++)
- if (x[i] > y[i]) return 1;
- else if (x[i] < y[i]) return -1;
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement