体験文字列の比較
965 ワード
Copyright(c)2013,
*All rights reserved.
* :
* :2013 12 03
* :v1.0
* :
* :
#include <iostream>
#include <string>
using namespace std;
int main()
{
string m,n;
cout<<" :"<<endl;
cin>>m>>n;
if(m==n)
cout<<"m,n "<<endl;
else if(m>n)
cout<<m<<" "<<n<<" , !!"<<endl;
else
cout<<n<<" "<<m<<" , !!!"<<endl;
cout<<" "<<endl;
return 0;
}
実行結果:
心得体得:文字の演算は他の変数と同じで、とても便利で、stringの不思議な機能