import java.util.*;
public class Solution {
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
* 比较版本号
* @param version1 string字符串
* @param version2 string字符串
* @return int整型
*/
public int compare (String m, String n) {
// write code here
int left = 0, left2 = 0, right = m.length(), right2 = n.length();
while(left < right || left2 < right2 ){
int x = 0;
int y = 0;
while (left < right && m.charAt(left) != '.'){
x = x * 10 + m.charAt(left) - '0';
left++;
}
while (left2 < right2 && n.charAt(left2) != '.'){
y = y * 10 + n.charAt(left2) - '0';
left2++;
}
if (x < y){
return -1;
}
if (x > y){
return 1;
}
left++;
left2++;
}
return 0;
}
}