[A89] Re: [OT] C++ help


[Prev][Next][Index][Thread]

[A89] Re: [OT] C++ help




Could be dangerous if the input was not 6 chars, but that's easy
enough to check for.

-Kevin

On Fri, 01 Feb 2002 18:51:50 +0100, you wrote:

>
>Wbat about:
>
>
>  string input;
>
>  cin >> input;
>  if(input[0] =3D=3D input[5} && input[1] =3D=3D input[4] && input[2] =
=3D=3D input[3]) {
>    cout << "Palindrome!" << endl;
>  } else {
>    cout << "not! try another one" << endl;
>  }
>
>
>///Olle
>
>




Follow-Ups: References: