#include <stdio.h>

long recursion(int n);

void main()
{
int n;
long result;

printf("input a integer number:\n");
scanf("%d",&n);

result=recursion(n);
printf("%d!=%ld\n",n,result);
}

long recursion(int n)
{
long temp_result;
if(n<0)
{
printf("n<0,input error!\n");
}
else if(n==0 || n==1)
{
temp_result=1;
}
else
{
temp_result=recursion(n-1)*n;
}
return temp_result;
}

最新文章

  1. [LeetCode] Implement Queue using Stacks 用栈来实现队列
  2. POJ1740A New Stone Game[组合游戏]
  3. haproxy+keepalived实现高可用负载均衡
  4. C#借助谷歌翻译实现翻译小工具(二)添加托盘图标
  5. JdbcTemplate查询数据 三种callback之间的区别
  6. php里ezpdo orm框架初探
  7. 如何改变dreamweaver的编码方式
  8. Learning Web
  9. iOS 5 故事板入门(3)
  10. 3--OC -- 点语法
  11. element-ui对话框组件Dialog在回调事件opened获取组件滚动条scrollTop的问题
  12. Registrator中文文档
  13. 实验吧web题:
  14. Python基础知识:if语句
  15. 网页性能优化之异步加载js文件
  16. C# System.IO.FileAccess
  17. Python 字典 fromkeys()方法
  18. Win10无法启动软件提示MSVCP110.dll丢失
  19. [ZT] 医学图像分析相关的会议
  20. 【洛谷mNOIP模拟赛Day1】T1 斐波那契

热门文章

  1. 2、Docker基础用法
  2. Win10下JDK下载与环境变量配置
  3. R-画图
  4. Python玩转Arduino——简单介绍
  5. Java并发编程的挑战
  6. python之做一个简易的翻译器(二)
  7. 【转】 HDMI介绍与流程
  8. append导致TypeError: &#39;NoneType&#39; object is not iterable
  9. gulp打开gbk编码的html文件乱码
  10. 【数据结构】运输计划 NOIP2015提高组D2T3