pages:
  • 1
AhUrA SAYS

man soalo dorost motevajeh nemisham !! mage nemige begid ke yek kalame ba reverese hamun kalame yeki hast ya na ?!! pas chera in code bayad wrong she ?!!

getline(cin, str); // dur rikhtane khate aval
while ( getline(cin, str) )
    if ( equal(str.begin(), str.end(), str.rbegin()) ) puts("YES");
    else                                               puts("NO");
AMiR SAYS

First of all, the string itself may not be a palindrome! The sequence of the numbers that you hit while typing the string with a cellphone's keypad is the thing that must be palindromic.

Seconde, your program must be case insensitive.

The problem specification states the combination of the cellphone's keypad:

2: ABC, 3: DEF, 4: GHI, 5: JKL, 6: MNO, 7: PQRS, 8: TUV, 9: WXYZ

According to this, your code should output YES for this string: AAABBB. Because the sequence is 222222 which is palindrome.

Same goes to something like that: AaABBb or ADGEB.

AhUrA SAYS

kheyly mamnunam azat :)