From 4b478b4b34b948cee8d08476c085658d9c83a498 Mon Sep 17 00:00:00 2001 From: shra21 <76639040+shrawani21@users.noreply.github.com> Date: Sun, 24 Apr 2022 17:34:13 +0530 Subject: [PATCH] Create solution1.c --- solution1.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 solution1.c diff --git a/solution1.c b/solution1.c new file mode 100644 index 0000000..941f73f --- /dev/null +++ b/solution1.c @@ -0,0 +1,16 @@ +#include + +int main() +{ + int n; + scanf("%d", &n); + int counts[5] = {1, 1, 1, 1, 1}; + while (n > 1) + { + n -= 1; + for (int i = 1; i < 5; i++) + counts[i] += counts[i - 1]; + } + printf("%d", counts[0] + counts[1] + counts[2] + counts[3] + counts[4]); + return 0; +}