3
整数的逆序_c语言的技术博客_51CTO博客
source link: https://blog.51cto.com/u_15652430/5723629
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
整数的逆序
精选 原创思路:首先定义三个变量abc,让用户输入一个整数存放在变量a中
然后让a对10取余数得到其个位数,将这个个位数赋值给b
每次的a/10使得a每次丢到其各位,得到一个新的整数,循环第二三步
c=c*10+b的作用:每次循环使得上次循环的位数大10倍
- 赞
- 收藏
- 评论
- 分享
- 举报
上一篇:循环语句
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK