program Project2;<br><br>{$APPTYPE CONSOLE}<br><br>uses<br> SysUtils,<br> Windows;<br><br>var<br> hOut: Cardinal;<br> i: Integer;<br> Pos: COORD;<br> s: String;<br>begin<br> { TODO -oUser -cConsole Main : Insert code here }<br> WriteLn('开始运行控制台程序');<br> hOut := GetStdHandle(STD_OUTPUT_HANDLE);<br> Pos.X := 0;<br> Pos.Y := 1;<br> for i := 0 to 5 do<br> begin<br> Write(i);<br> Sleep(1000);<br> SetConsoleCursorPosition(hOut, Pos);<br> end;<br> WriteLn('按任意键退出');<br> Read(s);<br>end.