#include#include #include using namespace std; class Solution { public: int compareVersion(string version1, string version2) { vector v1; vector v2; int p=0; /*方法一:OK*/ /*for(int i=0;i = len1){ if(v2[j--]!=0) return -1; } return 0; }else{ //str1和str2前len1位不都相等,直接判斷第i位 if(v1[i] v2[i]) return 1; if(v1[i] =v1.size()&&i 0) return -1; } } else if(i>=v2.size()&&i 0) return 1; } } return 0; } }; int main() { string v1,v2; Solution S; cin>>v1>>v2; cout<