From 1eefd58ca4fdb5d2f51f657bfd70c9a89a4707db Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Thu, 24 May 2018 21:39:58 +0800 Subject: initial commit --- euler18.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 euler18.c (limited to 'euler18.c') diff --git a/euler18.c b/euler18.c new file mode 100644 index 0000000..281dc77 --- /dev/null +++ b/euler18.c @@ -0,0 +1,43 @@ +#include +#define MAX 15 + +int max(int i,int j) +{ + if (i>j) + return i; + else + return j; +} + +int main() +{ + int triangle[MAX][MAX]; + int answer[MAX][MAX]; + int maxtotal=0; + int i,j; + for (i=0; imaxtotal){ + maxtotal=answer[i][j]; + } + } + } + printf("%d\n",maxtotal); + return 0; +} + + -- cgit v1.2.3