1 #include<iostream> 2 using namespace std; 3 4 int main() 5 6 { 7 8 string str1=("124"); 9 string str2=("531"); 10 string str3="1234"; 11 bool answer; 12 answer=str1>str2; 13 cout<<answer<<endl; //0 从第一个不同的数字或者字母比较大小 14 15 answer=str3>str1; 16 cout<<answer<<endl; //0 17 answer=str2>str3; 18 cout<<answer<<endl; //1 19 return 0; 20 21 }