TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Glenn Booker <[log in to unmask]>
Reply To:
Date:
Wed, 19 Apr 2000 07:51:56 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (25 lines)
That's correct.  An example is "Madam, I'm Adam."  If you ignore the spaces and punctuation, that becomes MADAMIMADAM, which is the same sequence of letters either forward or backward.  Notice that the "I" is the middle of the string, and doesn't have to match any other letters.  If a string has an even number of letters, then the two middle letters much match for it to be a palindrome.

Glenn Booker

---------- Original Message ----------------------------------
From: Jacob Sparre Andersen <[log in to unmask]>
Reply-To: Jacob Sparre Andersen <[log in to unmask]>
Date:         Wed, 19 Apr 2000 12:31:02 +0200

>Colin Brown:
>
>> question, write an ada program using recursion to find out if the text
>> entered is a palindrome. I sort of understand how recursion works, I
>
>Is a palindrome a word where the first and the last letter
>is the same, the second and the second to last letter is the
>same, and so on?
>
>Greetings,
>
>Jacob
>--
>"Sleep is just a cheap substitute for coffee"
>

ATOM RSS1 RSS2