输出一个整数的每一位:递归调用
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
void print(int num)
{
if (num >= 10)
print(num / 10);
printf("%d", num % 10);
}
int main()
{
int num = 10;
scanf_s("%d", &num);
print(num);
system("pause");
return 0;
}
本文出自 “Stand out or Get out” 博客,转载请与作者联系!
原文地址:http://jiazhenzhen.blog.51cto.com/10781724/1709790