您的位置:首页 > 编程语言 > C语言/C++

C语言实现 递归法 数字转换成字符串

2014-07-16 21:08 423 查看
#include <stdio.h>
#include <stdlib.h>
int binary_to_ascii(unsigned int value)
{
unsigned int quotient;
quotient = value/10;
if( quotient != 0)
binary_to_ascii(quotient);
putchar ( value % 10 + '0' );
}
int main()
{
unsigned int n;
scanf("%d",&n);
binary_to_ascii(n);
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐