recursive
2016-05-04 09:05
351 查看
#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int f(int n) { int ret = 0; if(n>1) { ret = n*f(n-1); } else if(n==1) { ret = 1; } return ret; } int main(int argc, char *argv[]) { char c; c = getchar(); printf("%d\n",f(4)); return 0; }
相关文章推荐
- 背景建模与前景检测1(Background Generation And Foreground Detection)
- java 验证码 gif 验证码 动图 验证码
- php print 函数
- tomcat做服务器时,当通过项目名访问jsp页面的时候,网页中的相对路径无效
- a stranger program
- 常用JVM配置参数
- oracle 自定义类型 type / create type
- 不可忽视的 .NET 应用5大性能问题
- 用来实现OJ判题的windows批处理
- 奋斗吧,程序员——第二十五章 酒酣胸胆尚开张,鬓微霜,又何妨
- CE_ZC_01
- 参考资料和api地址
- mallo(0)
- Android Studio 快捷键总结(OS X)
- python中re模块的使用
- angularJS 开发原则之约定优先原则
- git cherry-pick后无权限git push的一个记录
- strtok()函数
- crazy pointer
- ArraySegment