返事の有無を判断する
596 ワード
#include
using namespace std;
int main() {
char str[100];
int len = 0;
bool flag = true;
cout << "please cin a str" << endl;
int i = 0;
str[i] = getchar();
while (str[i] != '
')
{
i++;
str[i] = getchar();
}
len = i - 1;
for (int j = 0; j < (len / 2); j++)
{
if (str[j] != str[len - j])
{
flag = false;
break;
}
}
if (false == flag)
{
cout << " " << endl;
}
else
{
cout << " " << endl;
}
system("pause");
return 0;
}