From c3c19f3220485af12c3a5561ad1754bf546e7429 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 2 Sep 2017 15:48:01 +0200 Subject: Move *.lang files to a directory --- fibo.lang | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 fibo.lang (limited to 'fibo.lang') diff --git a/fibo.lang b/fibo.lang deleted file mode 100644 index e1a7a4a..0000000 --- a/fibo.lang +++ /dev/null @@ -1,31 +0,0 @@ -func printnum(int n) { - if (n == 0) {putc('0'); return;} - if (n < 0) {putc('-'); n = -n;} - while (n > 0) { - putc('0' + char(n % 10)); - n = n / 10; - } -} - -func int fibo(int n) { - int a := 0; - int b := 1; - int i := 0; - while (i < n) { - int c := a + b; - a = b; - b = c; - i = i + 1; - } - return b; -} - -func int main() { - int i := 0; - while (i <= 20) { - printnum(fibo(i)); - putc('\n'); - i = i + 1; - } - return 0; -} -- cgit v1.2.3-70-g09d2