view test.td @ 22:e331e4e816e4

now handling structs to some extend
author johnsen@johnsen-laptop
date Fri, 18 Apr 2008 23:45:45 +0200
parents 0fb2d13dce37
children 2d28b21faad6
line wrap: on
line source


int x = 4;

struct mystruct
{
   int x;
   int y;
}

int main()
{
    mystruct my;
    int x = 5;
    int y = 4;
    return add(6, 7);
}
int add(int x, int y)
{
    return x + y;
}

int fib(int n)
{
    if(n < 2)
        return n;
    
    return fib(n-1) + fib(n-2);
}

int nice(long s, short t)
{
    int y;
    byte x = 5 + t + y;
    if (x != 0)
        t = 5 + 1 * 5 * s + t;
    return 2 * (t + -1) - x;
}

int fac2(int n)
{
    int res = 1;
    while (n != 1)
    {
        res = res * n;
        n = n - 1;
    }
    return res;
}