比较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; } }
原文链接: https://www.cnblogs.com/xiangshancuizhu/archive/2011/06/29/2093708.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/27836
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!