c program

2008-02-24 1:34 am
a palindrome is a number which is the same when read from either end. for example,782387is a palindrome but123 not.
write a program to input a number and test whether it is palidrome.you should dtore the digits in an array.then compare the digit from both ends of the array.
sample output
enter a number:782387
the number is a paildrome.
sample output2
enter a number:123
the number is not a paildrome.

回答 (1)

2008-02-25 4:48 am
✔ 最佳答案
Here's a c-program using a long variable.
If you want to be able to enter unlimited sized numbers, you can read and store it with a character array, and compare the charactes in situ.
If you need more help, PM me.


2008-02-27 10:23:40 補充:
The string array option is has been added to the end of the above link.
So you can see both version.


收錄日期: 2021-04-13 15:12:14
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080223000051KK03035

檢視 Wayback Machine 備份