前田稔(Maeda Minoru)の超初心者のプログラム入門
![]()
![]()
/*★ vector の比較 前田 稔 ★*/ #include <stdio.h> #include <vector> using namespace std; vector |
![]()
// 文字列の比較
bool ciStringCompare(const string s1, const string s2)
{ bool ret;
ret = lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), ciChar);
return ret;
}
|
// 1文字の比較
bool ciChar(char c1, char c2)
{
return tolower(static_cast |
// 1文字の比較
bool ciChar(char c1, char c2)
{
int lc1 = tolower(c1);
int lc2 = tolower(c2);
if (lc1 < lc2) return true;
//if (lc1 > lc2) return true;
//if (lc1 < lc2 || lc1 > lc2) return true;
return false;
}
|
![]()