当前位置:网站首页>Exercise 6-6 using a function to output an integer in reverse order (20 points)
Exercise 6-6 using a function to output an integer in reverse order (20 points)
2022-06-11 22:25:00 【Xiaoyan y】
This problem requires the implementation of a simple function for finding the inverse number of integers .
Function interface definition :
int reverse( int number );
The function reverse The integer passed in by the user must be returned number In reverse order .
Sample referee test procedure :
#include <stdio.h>
int reverse( int number );
int main()
{
int n;scanf("%d", &n);
printf("%d\n", reverse(n));return 0;
}/* Your code will be embedded here */
sample input :
-12340
sample output :
-4321
int reverse(int number){
int sum=0,temp;
while(number!=0){
temp=number%10;
sum=sum*10+temp;
number=number/10;
}
return sum;
}
边栏推荐
- SVN本地部署server和cleint 并用阿里云盘自动备份
- 3.2 测试类的命名规则
- 电脑强制关机 oracle登录不上
- Implementation of sequencelist sequence table
- 超标量处理器设计 姚永斌 第2章 Cache --2.3 小节摘录
- Lecture de l'article dense Visual SLAM for RGB - D Cameras
- Two methods to judge the storage of large and small end
- MySQL事务简介
- Daily question - Roman numeral to integer
- [Yu Yue education] Yancheng Normal University Advanced Algebra reference
猜你喜欢

One question per day -- verifying palindrome string

A simple example of linear regression in machine learning

Regular execution of shell scripts in crontab

SVN本地部署server和cleint 并用阿里云盘自动备份

astra pro双目相机ros下启动笔记

Prefabricated dishes in the trillion market have also begun to roll inside. How can brands stand out in the fierce competition?

Lecture de l'article dense Visual SLAM for RGB - D Cameras

NLP - fastText

Glory earbud 3 Pro with three global first strong breakdowns flagship earphone Market

Implementation stack and queue
随机推荐
论文阅读《Dense Visual SLAM for RGB-D Cameras》
Dynamic memory management (1)
leetcode 257. Binary Tree Paths 二叉树的所有路径(简单)
926. 将字符串翻转到单调递增
[Yu Yue education] calculus of Zhejiang University in autumn and winter 2021 (I) reference materials
Sword finger offer array question type summary
Tkinter study notes (IV)
学1个月爬虫就月赚6000?别被骗了,老师傅告诉你爬虫的真实情况
Addition without addition, subtraction, multiplication, Division
Custom implementation offsetof
SequenceList顺序表的实现
Conception du Processeur superscalaire Yao yongbin chapitre 2 cache - - sous - section 2.4 extrait
Tkinter学习笔记(三)
The device is in use when win10 ejects USB
Superscalar processor design yaoyongbin Chapter 2 cache -- Excerpt from subsection 2.4
論文閱讀《Dense Visual SLAM for RGB-D Cameras》
常用分页方法总结
Bit operation in leetcode
Unity3D getLaunchIntentForPackage 获取包返回null问题
Are you still using localstorage directly? It's time to raise the bar