From d485271d5e0472676cf9ec6d41f1605d39a24424 Mon Sep 17 00:00:00 2001 From: ivy-Lee-2333 Date: Mon, 19 Feb 2024 11:05:40 +0000 Subject: [PATCH] add assignment/C/lixinyi/work1. Signed-off-by: ivy-Lee-2333 --- assignment/C/lixinyi/work1 | 109 +++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 assignment/C/lixinyi/work1 diff --git a/assignment/C/lixinyi/work1 b/assignment/C/lixinyi/work1 new file mode 100644 index 0000000..3636014 --- /dev/null +++ b/assignment/C/lixinyi/work1 @@ -0,0 +1,109 @@ +#include +#include +#include +#include +// assert(x)的作用是,如果x为假,则报错并终止程序运行 + +// 返回n的降k阶乘:n*(n-1)*(n-2)*...*(n-k+1) +int falling(int n, int k) +{ + int result =1; + for(int i=0;i