Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Re: Palindrome

Reply
Thread Tools

Re: Re: Palindrome

 
 
Tim Churches
Guest
Posts: n/a
 
      11-13-2003
Ulrich Schramme <> wrote:

>
> Georgy Pruss wrote:

> > Knowing what your program should do, could also help.
> > G-:
> >

>
> As far as I know is a palindrome a word that you can read from both
> sides. Sorry, but English is not my native language. So I donīt have
> an
> English example handy. But the German name 'OTTO' is a palindrome.


More test cases:

The very first palindrome:
Madam, I'm Adam.

Some palindromic names of Australian towns:
Tumut
Glenelg

Napoleon's palindrome (definitely apocryphal):
Able was I `ere I saw Elba.

A palindrome commentary on the prohibition of streaking:
Named under a ban, a bared, nude man.

Tim C
 
Reply With Quote
 
 
 
 
yousafzai yousafzai is offline
Junior Member
Join Date: Jun 2011
Location: pakistan
Posts: 6
 
      06-05-2011
Quote:
Originally Posted by Tim Churches View Post
Ulrich Schramme <> wrote:

>
> Georgy Pruss wrote:

> > Knowing what your program should do, could also help.
> > G-:
> >

>
> As far as I know is a palindrome a word that you can read from both
> sides. Sorry, but English is not my native language. So I donīt have
> an
> English example handy. But the German name 'OTTO' is a palindrome.


More test cases:

The very first palindrome:
Madam, I'm Adam.

Some palindromic names of Australian towns:
Tumut
Glenelg

Napoleon's palindrome (definitely apocryphal):
Able was I `ere I saw Elba.

A palindrome commentary on the prohibition of streaking:
Named under a ban, a bared, nude man.

Tim C











///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
void main()
{
int count=0;
string std;
cout<<"Please type your string:\n(type # if u does not want to enter more characters: ) ";
getline(cin,std,'\n');
string std1(std.begin(),std.end());
reverse (std1.begin(), std1.end());
int size=(std.length());
for(int i=0;i<std.length();i++)
{
if(std[i]==std1[i])
{
count++;
continue;
}
}
if(count==size)
cout<<"yes it is palindrome\n";
else
cout<<"no it is not a palindrome\n";
}
 
Reply With Quote
 
 
 
 
yousafzai yousafzai is offline
Junior Member
Join Date: Jun 2011
Location: pakistan
Posts: 6
 
      06-05-2011
////////////////////////////////////////////////////////////////////////////////////////
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
void main()
{
int count=0;
string std;
cout<<"Please type your string:\n(type # if u does not want to enter more characters: ) ";
getline(cin,std,'\n');
string std1(std.begin(),std.end());
reverse (std1.begin(), std1.end());
int size=(std.length());
for(int i=0;i<std.length();i++)
{
if(std[i]==std1[i])
{
count++;
continue;
}
}
if(count==size)
cout<<"yes it is palindrome\n";
else
cout<<"no it is not a palindrome\n";
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Palindrome using StringBuffer cat_dog_ass Java 4 01-05-2013 08:37 AM
Replacing palindrome substrings of an input string with a given string Tung Chau C Programming 1 08-06-2004 07:27 PM
Palindrome Runic911 Python 24 11-15-2003 12:08 AM
Re: Palindrome Pierre Quentel Python 2 11-13-2003 06:11 PM
Palindrome (HELP) Lorin Leone C++ 4 11-13-2003 08:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57