From 5e496e95dbb2486bafff475a570d2ca19faa7b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=91=9E=E6=B3=BD?= <2456229381@qq.com> Date: Sun, 20 Nov 2022 15:41:25 +0000 Subject: [PATCH] add TP4-1. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王瑞泽 <2456229381@qq.com> --- TP4-1 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 TP4-1 diff --git a/TP4-1 b/TP4-1 new file mode 100644 index 0000000..d0ad172 --- /dev/null +++ b/TP4-1 @@ -0,0 +1,66 @@ +#include +#include +#include +using namespace std; + + +//question 1 + +int uniquePaths(int m, int n){ + int i=0; + int j=0; + //建立储存路径数的二维数组 + int chemin[m][n]={0}; + if((m==1)||(n==1)){ + return 1; + }else{ + //为边界赋初始值 + for(i=0;i