//输入两个可能有前导 0 的大整数,a,b请输出他们谁大谁小 #include <iostream> #include <string> #include <string.h> using namespace std; #define M 100005 int main() { char a[M], b[M]; char *pa, *pb; pa = a; pb = b; cin >> a >> b; while(*pa == '0')pa++; while(*pb == '0')pb++; if(strlen(pa) > strlen(pb)){ cout<<"first"<<endl; } else if(strlen(pa) < strlen(pb)){ cout<<"second"<<endl; } else{ int res = strcmp(pa, pb); if(res > 0){ cout<<"first"<<endl; }else if(res < 0){ cout<<"second"<<endl; } else{ cout<<"same"<<endl; } } return 0; }