n!的另类算法
来源:互联网 发布:淘宝卖家地址哪里改 编辑:程序博客网 时间:2024/05/16 07:36
#include <stdio.h> //归结于递归问题
#include <stdlib.h>
static int ret = 1;
static int n = 0;
int han(int s)
{
if( s > 0 )
{
han(s-1);
n = n + 1;
ret = ret * n;
}
return ret;
}
int main(int argc, char *argv[])
{
han(4);
printf("%d",ret);
return 0;
}
#include <stdlib.h>
static int ret = 1;
static int n = 0;
int han(int s)
{
if( s > 0 )
{
han(s-1);
n = n + 1;
ret = ret * n;
}
return ret;
}
int main(int argc, char *argv[])
{
han(4);
printf("%d",ret);
return 0;
}
0 0
- n!的另类算法
- 求N³(n的三次方)的另类算法
- 俄罗斯方块程序的另类算法
- 俄罗斯方块程序的另类算法
- java 冒泡的另类算法
- 欧几里得算法的另类想法
- 一个全字匹配的另类算法
- 另类的链表数据结构以及算法
- LIS,LDS的另类算法(转载)
- AC自动机的另类匹配算法
- 最小费用最大流的另类算法
- CRC算法另类应用
- 另类算法题
- 算法 n!的0
- N*N棋盘的非递归算法
- 生成n*n蛇形矩阵的算法
- 生成n*n蛇形矩阵的算法
- 算法 求N的阶层 N!
- LinuxCast学习笔记二十七:raid_basic
- Linux 控制台聊天程序
- 转载-Mac系统U盘制作(Windows下)
- 安装websphere6.1,运行install时没有反应
- 嵌入式Linux平台搭建日记2014/3/7
- n!的另类算法
- HDOJ1017 A Mathematical Curiosity
- bash:git:command not found解决方法
- 儿童也是天天唱,那时三好学生,五好学生
- Android Application 对象介绍
- POJ 3320 Jessica's Reading Problem 尺取法
- 字符删除
- Oracle常用SQL集锦
- 详解Java解析XML的四种方法