当前位置:网站首页>Exercise 6-6 use a function to output an integer in reverse order
Exercise 6-6 use a function to output an integer in reverse order
2022-07-03 14:09:00 【ᯤ⁹ᴳ⁺ ·】
exercises 6-6 Use the function to output an integer in reverse order (20 branch )
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 :
-4321int reverse( int number ){
if(number<0){
printf("-");
number=-number;
}
int n=0,r;
do{
n=n*10+number%10*10;
number/=10;
}while(number);
r=n/10;
return r;
}

边栏推荐
- Multi person collaborative data annotation based on Baidu brain easydata from scratch
- Print. JS -- web page file printing
- Mysql:insert date:sql error [1292] [22001]: data truncation: incorrect date value:
- 消息订阅与发布
- Exercise 9-3 plane vector addition
- JS get DPI, PX to cm, cm to PX
- JS download files through URL links
- Toast UI editor (editor allows you to edit your markup document using text or WYSIWYG, with syntax highlighting, scrolling synchronization, real-time preview and chart functions.)
- Redis: commandes d'action pour les données de type chaîne
- How to promote the progress of project collaboration | community essay solicitation
猜你喜欢
[email protected]纳米粒子"/>金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子

Exercise 8-7 string sorting

关于回溯问题中的排列问题的思考(LeetCode46题与47题)

QT learning 23 layout manager (II)

Current situation, analysis and prediction of information and innovation industry

Article content typesetting and code highlighting

Go language web development series 30: gin: grouping by version for routing

从零开始的基于百度大脑EasyData的多人协同数据标注

Exercise 6-2 using functions to sum special A-string sequences

Exercise 7-6 count capital consonants
随机推荐
[Jilin University] information sharing of postgraduate entrance examination and re examination
核酸修饰的金属有机框架药物载体|PCN-223金属有机骨架包载Ad金刚烷|ZIF-8包裹阿霉素(DOX)
QT learning 19 standard dialog box in QT (top)
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
玖逸云黑免费无加密版本源码
Selenium browser (1)
7-7 12-24 hour system
Solve the problem of dormitory router campus network sharing login
Solution to failure or slow downloading of electron when electron uses electron builder to package
GoLand 2021.1: rename the go project
Qt学习17 对话框及其类型
Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email
Exercise 6-1 classify and count the number of characters
QT learning 23 layout manager (II)
[acnoi2022] guess numbers
Exercise 6-2 using functions to sum special A-string sequences
交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
Use and design of Muduo buffer class
Common plug-ins for vite project development
Interface for querying IP home