summaryrefslogtreecommitdiff
path: root/progs/a811.py
diff options
context:
space:
mode:
Diffstat (limited to 'progs/a811.py')
-rw-r--r--progs/a811.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/progs/a811.py b/progs/a811.py
new file mode 100644
index 0000000..2788477
--- /dev/null
+++ b/progs/a811.py
@@ -0,0 +1,19 @@
+def cal_sum(n):
+ a = 3
+ b = 0
+ c = 2
+ if (n == 0):
+ return 3
+ if (n == 1):
+ return 3
+ if (n == 2):
+ return 5
+ sum = 5
+ while (n > 2):
+ d = a + b
+ sum = sum + d
+ a = b
+ b = c
+ c = d
+ n = n-1
+ return sum \ No newline at end of file