[阅读: 514] 2004-12-16 08:07:51
#include <windows.h>
#include <iostream>
using namespace std;
void gotoxy( short x, short y ) {
HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
COORD position = { x, y };
SetConsoleCursorPosition( hStdout, position );
}
int main() {
cout << "top left" << endl;
cout << "next line";
gotoxy(30, 2);
cout << "top left again";
return 0;
}