Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   Big problem on C++ (http://www.go4expert.com/forums/cpp-t6381/)

[LinkZ] 16Sep2007 20:39

Big problem on C++
 
Write a program that uses a stack to determine if a string is a palindrome (i.e, the string is spelled identically backward and forward). The program should ignore spaces and punctuation.

Sample output:
Enter a line of text:
able was i ere i saw elba
“able was i ere i saw elba” is a palindrome

Enter a line of text:
this is not a palindrome
“this is not a palindrome” is not a palindrome

Help please guys =(

DaWei 16Sep2007 23:23

Re: Big problem on C++
 
Be sure and read the "Before you make a query" thread. We don't actually write code on demand for people, we help with the code THEY write and have trouble with.

What you want to do is think how you would go about testing for a palindrome, whether you use a stack or some other method. Express it in your native language. Write down the steps. This would be called "pseudo-code". Once you've gotten that far, translate it into C++ as best you can.

If you do post code, for help, be sure and use code tags to preserve the indentation. You'll find that in the "Before you make a query" thread, too, along with some material emphasizing how important it is that you give complete, lucid information regarding any problems you have.

ME_ME 21Sep2007 11:06

Re: Big problem on C++
 
Wahh... this question is for our Assignment... PLs give us the solution.
Onegai!!! ^0^


All times are GMT +5.5. The time now is 20:29.