* */
# include <iostream>
# include <string>
using namespace std;
int main(){
string str1, str2;
cout<<"input two strings:"<<endl;
cin>>str1>>str2;
if(str1>str2){
cout<<"the big string is "<<str1<<endl;
}
else
cout<<"The big string is "<<str2<<endl;
return 0;
}
/*比较两个string对象的长度并输出
*/
# include <iostream>
# include <string>
using namespace std;
int main(){
cout<<"input two strings:"<<endl;
string str1, str2;
cin>>str1>>str2;
string::size_type len1, len2;
len1 = str1.size();
len2 = str2.size();
if(len1 == len2)
cout<<"\""<<str1<<"\""<<" and "<<"\""<<str2<<"\""<<" have the same length"<<endl;
else if(len1>len2)
cout<<"\""<<str1<<"\""<<" is longer than "<<"\""<<str2<<"\""<<endl;
else
cout<<"\""<<str2<<"\""<<" and "<<"\""<<str1<<"\""<<" have the same length"<<endl;
return 0;
}