以下代码在Ubuntu14.10下实现

/*-------------------------
filename is demo.cpp
--------------------------*/
#include <iostream>
using namespace std;
int main(){
    string str1="abcde";
    string str2="bdewqf";
    if(str1<str2)
        cout<<str1<<endl;
    else
        cout<<str2<<endl;
}

c++中string类型可以直接进行比较

相关文章:

  • 2021-08-14
  • 2021-11-15
  • 2021-05-27
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-24
  • 2021-07-19
  • 2021-12-03
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
相关资源
相似解决方案