测试整数是否是c语言的回文 [英] Test if an integer is a palindrome in c language

查看:56
本文介绍了测试整数是否是c语言的回文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好伙伴,


有没有人知道如何编写一个函数来测试一个整数是否是C语言的
palindrome?

Hello mates,

Does anyone know how to write a function that tests if an integer is a
palindrome in C language?

推荐答案

Wabz写道:
Wabz wrote:

有谁知道怎么写一个测试的函数如果一个整数是C语言的

回文?
Does anyone know how to write a function that tests if an integer is a
palindrome in C language?



是的。我很确定有人这样做。


---- ==通过Newsfeeds.Com发布 - 无限制 - 无限制 - 安全Usenet新闻== ---- http://www.newsfeeds.com 世界排名第一的新闻组服务! 120,000多个新闻组

---- =东海岸和西海岸服务器农场 - 通过加密实现全隐私= ----

Yes. I''m quite sure that someone does.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


8月14,1:19 pm,Kevin Handy< k ... @ srv.netwrote:
On Aug 14, 1:19 pm, Kevin Handy <k...@srv.netwrote:

Wabz写道:
Wabz wrote:

有谁知道如何编写一个函数来测试一个整数是否是一个
palindromein C语言?
Does anyone know how to write a function that tests if an integer is a
palindromein C language?



是的。我很确定有人这样做。


---- ==通过Newsfeeds.Com发布 - 无限制 - 无限制 - 安全Usenet新闻== ---- http:/ /www.newsfeeds.com世界排名第一的新闻组服务! 120,000多个新闻组

---- =东和西海岸服务器农场 - 通过加密的总隐私= ----


Yes. I''m quite sure that someone does.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----http://www.newsfeeds.comThe #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



可能有人可能会帮我写上说的程序吗?

Could this someone possibly help me write the said program?


" Wabz"写道:
"Wabz" writes:

8月14日下午1:19,Kevin Handy< k ... @ srv.netwrote:
On Aug 14, 1:19 pm, Kevin Handy <k...@srv.netwrote:

> Wabz写道:
>Wabz wrote:

有没有人知道如何编写一个函数来测试整数是否是一个
回文C语言?
Does anyone know how to write a function that tests if an integer is a
palindromein C language?


是的。我很确定有人这样做。


Yes. I''m quite sure that someone does.


这个人有没有可能帮我写上述程序?
Could this someone possibly help me write the said program?



首先提取整数的各个数字。您可能会发现

模运算符%有用。还有另一种方法,涉及sprintf()在

< stdio.h>中,但如果这是学校作业,那么教师可能会以模数方式预期。

Start by extracting the individual digits of the integer. You may find the
modulo operator, %, helpful. There is another way, involving sprintf() in
<stdio.h>, but if this is a school assignment, the instructor probably
expects the modulo way.


这篇关于测试整数是否是c语言的回文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆