比较string大小,其实很简单,练手吧,快改找工作了,谁跟我提点建议啊?谢谢啦

只看了C++,据说还要考察操作系统神马的:

不说了,把代码贴上吧:

#include <iostream>
#include<string>
using namespace std;


int main()
{
  string s1,s2;
  bool flag = true;
  cout << "Please input two strings s1 and s2:" << endl;
  while (flag == true && cin>>s1>>s2 )
  {
	  cout << (s1<s2?s1:s2) << " is small"<<endl
	  << "if you want to continue comparing ,please input 1,else 0"<<endl;
	  cin >> flag;
  }
 
}

相关文章:

  • 2022-01-02
  • 2021-10-19
  • 2021-05-11
  • 2021-12-31
  • 2021-09-12
  • 2021-09-06
  • 2021-10-20
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2021-04-09
  • 2022-12-23
  • 2021-06-11
  • 2021-09-14
  • 2022-12-23
相关资源
相似解决方案