标签:code 字符 c++ void cout inf else info sci
void test()
{
string a, b;
cin >> a >> b;
if(a == b)
{
cout << "equal" << endl;
}else if(a < b)
{
cout << "a < b" << endl;
}else if(a > b)
{
cout << "a > b" << endl;
}
cout <<"a :" <<int(‘a‘) <<"A :"<< int(‘A‘) << endl;
}
可以看出,string比较按照两个字符串对应的ASCI码值进行比较。
标签:code 字符 c++ void cout inf else info sci
原文地址:https://www.cnblogs.com/lif323/p/9311237.html