当前位置:网站首页>Exercise 10-8 recursive implementation of sequential output of integers
Exercise 10-8 recursive implementation of sequential output of integers
2022-07-03 14:09:00 【ᯤ⁹ᴳ⁺ ·】
exercises 10-8 Recursive implementation sequentially outputs integers (15 branch )
This question requests to realize a function , Output an integer in bit order .
Function interface definition :
void printdigits( int n );
function printdigits
Should be n
Each digit of the is printed in order from high to low , Each number is on one line .
Sample referee test procedure :
#include <stdio.h>
void printdigits( int n );
int main()
{
int n;
scanf("%d", &n);
printdigits(n);
return 0;
}
/* Your code will be embedded here */
sample input :
12345
sample output :
1
2
3
4
5
void printdigits( int n ){
if(n/10>0){
printdigits(n/10);
}
printf("%d\n",n%10);
}
边栏推荐
- [acnoi2022] guess numbers
- Why don't I have a rookie medal
- How to bold text in AI
- Go language web development series 25: Gin framework: using MD5 to verify the signature for the interface station
- QT learning 19 standard dialog box in QT (top)
- QT learning 20 standard dialog box in QT (middle)
- Example analysis of QT learning 18 login dialog box
- Go language web development series 29: Gin framework uses gin contrib / sessions library to manage sessions (based on cookies)
- Redis: operation command of string type data
- QT learning 25 layout manager (4)
猜你喜欢
Solve MySQL 1045 access denied for user 'root' @ 'localhost' (using password: yes)
Nucleic acid modified metal organic framework drug carrier | pcn-223 metal organic framework encapsulated ad adamantane | zif-8 encapsulated adriamycin (DOX)
Installation impression notes
[email protected])|制备路线"/>
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?
Summary of common error reporting problems and positioning methods of thrift
Qt学习24 布局管理器(三)
Use and design of Muduo buffer class
Message subscription and publishing
小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。
随机推荐
Qt学习23 布局管理器(二)
Redis:Redis的数据结构、key的操作命令
金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
selenium 浏览器(1)
Go: send the get request and parse the return JSON (go1.16.4)
Function calling convention
Duet date picker (time plug-in that can manually enter the date)
Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
Common plug-ins for vite project development
QT learning 20 standard dialog box in QT (middle)
concat和concat_ws()区别及group_concat()和repeat()函数的使用
jvm-运行时数据区
Richview trvstyle liststyle list style (bullet number)
Qt学习25 布局管理器(四)
Redis: redis data structure and key operation commands
Vite project commissioning
Collection of mobile adaptation related articles
Selenium browser (1)
[acnoi2022] guess numbers
Common mixins