[A89] Re: [OT] C++ help


[Prev][Next][Index][Thread]

[A89] Re: [OT] C++ help




it would be easier just to do a for the whole number of the length of the
string divided by 2, that would cover the number of times to loop to check
any length of palindrome. then just have it check:
 if instr(string,i,1)<>instr(string,len(string)-i+1,1) then goto
notapalindrome
then just let it drop through if all the checks are good
sorry its in basic, dont like c/++

>
> Yes In fact I do have an idea.
> I have it written in Basic but you can easily convert.
> Good Luck! :)
>
> pgrm()
> Lbl beg
> ClrIO
> Input "Possible Palidrome:",i
> If i<100000 or i>999999:Goto beg
> iPart(i/1000)->a
> i-a*1000->b
> iPart(b/100)->c
> b-c*100->d
> iPart(d/10)->e
> d-e*10->f
> c+10*e+100*f->g
> If g=a Then
> Disp "yes"
> Else
> Disp "no"
> EndIf
> Pause
> ClrIO
> DispHome
> EndPrgm
> ----- Original Message -----
> From: "Ashley Harrison" <skinnej16@juno.com>
> To: <assembly-89@lists.ticalc.org>
> Sent: Thursday, January 31, 2002 4:37 PM
> Subject: [A89] [OT] C++ help
>
>
> >
> >
> > I need some help w/ a program for c++, i need to take a six-digit number
> > entered by the user that could be a possible palindrome(a six digit
> > number that reads the same front and back, i.e. 123321, 456654), the
> > program has to determine if the number is a palindrome or not, and all i
> > can use is if/else statements and the switch statement and logical
> > operators, any ideas?
> >
> > Chris
> > ________________________________________________________________
> > GET INTERNET ACCESS FROM JUNO!
> > Juno offers FREE or PREMIUM Internet access for less!
> > Join Juno today!  For your FREE software, visit:
> > http://dl.www.juno.com/get/web/.
> >
>
>
>



Follow-Ups: References: