私も教えてもらって修正したものを貼っておきますね。
http://codepad.org/MZixv48O
(↑ #include <windows.h>とGetTickCount()回り残ってます。)