Thursday, January 6, 2011

my stuff

BIG or little endian


#include

int main()
{
int n = 1;
if(*(char*) &n = 1)
{
printf("LE");
}
else
printf("HE");
}

Tower of hanio baby


#include

void tower(int n, char from, char to, char center)
{
tower(n-1,from,center, to);
tower(n-1,center,to,from);
}
int main()
{
int f,t,c;
tower(4, f, t ,c);
}

No comments:

Post a Comment