Dec 16, 2008

Give you a simplest computer: CPU + 2k RAM. Write a slowest program.

Give you a simplest computer: CPU + 2k RAM. Write a slowest program.

(Hint: use the 2k as a huge number, then use a loop statement to loop from 0 to this number. It will take almost forever.)
The basic idea just use these trivial memory to run as more as possible computations


void foo()
{
Char arr[2048] //2k bytes
For(int i=0;i<2048;i++)
{
While(arr[i]!=0xff)
Arr[i]++;
}
}

No comments:

Post a Comment