Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 palendrom string
Index -> Programming, C++ -> C++ Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rickdragon




PostPosted: Tue Jan 13, 2004 2:52 pm   Post subject: palendrom string


# include <iostream.h>
# include <conio.h>
# include <string.h>
class string
{
public:
char s[100];
int a;
void getdata();
};
void string :: getdata()
{
cout<<"Enter your string :";
cin>>s;
int a,l,f,be,back;
l=strlen(s);
f=1;
be=0;
back=l-1;
while((be <= back) && f)
{
if(s[be] == s[back])
f = 1;
else
f = 0;
be++;
back--;
}
if(f)
cout<<"YES.....";
else
cout<<"NO......";
}
void main(void)
{
clrscr();
string st;
st.getdata();
getch();
}
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Jan 13, 2004 4:06 pm   Post subject: (No subject)

hey, it's nice that somebody is finally posting something in C++ Very Happy Have some bits 8)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
shorthair




PostPosted: Fri Jan 23, 2004 11:41 am   Post subject: (No subject)

Thats cool , i had to do that in turing for a contest
Display posts from previous:   
   Index -> Programming, C++ -> C++ Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: