2013-04-12
展开全部
turboc的
#include <stdio.h>
#include <conio.h>
int main()
{
int x, y;
gotoxy(5, 5);
printf("position: 5, 5");
x = wherex();
y = wherey();
getch();
gotoxy(x, y - 1);
getch();
}
控制闹烂台悉弯旦睁扰的
#include <windows.h>
#include <stdio.h>
#include <conio.h>
void gotoxy(HANDLE hOut, int x, int y);
void getxy(HANDLE hOut, int &x, int &y);
int main()
{
int x, y;
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
gotoxy(hOut, 5, 5);
printf("position: 5, 5");
getxy(hOut, x, y);
getch();
gotoxy(hOut, x, y - 1);
getch();
CloseHandle(hOut);
}
void gotoxy(HANDLE hOut, int x, int y)
{
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(hOut, pos);
}
void getxy(HANDLE hOut, int &x, int &y)
{
CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info;
GetConsoleScreenBufferInfo(hOut, &screen_buffer_info);
x = screen_buffer_info.dwCursorPosition.X;
y = screen_buffer_info.dwCursorPosition.Y;
}
#include <stdio.h>
#include <conio.h>
int main()
{
int x, y;
gotoxy(5, 5);
printf("position: 5, 5");
x = wherex();
y = wherey();
getch();
gotoxy(x, y - 1);
getch();
}
控制闹烂台悉弯旦睁扰的
#include <windows.h>
#include <stdio.h>
#include <conio.h>
void gotoxy(HANDLE hOut, int x, int y);
void getxy(HANDLE hOut, int &x, int &y);
int main()
{
int x, y;
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
gotoxy(hOut, 5, 5);
printf("position: 5, 5");
getxy(hOut, x, y);
getch();
gotoxy(hOut, x, y - 1);
getch();
CloseHandle(hOut);
}
void gotoxy(HANDLE hOut, int x, int y)
{
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(hOut, pos);
}
void getxy(HANDLE hOut, int &x, int &y)
{
CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info;
GetConsoleScreenBufferInfo(hOut, &screen_buffer_info);
x = screen_buffer_info.dwCursorPosition.X;
y = screen_buffer_info.dwCursorPosition.Y;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-04-12
展开全部
以前用C时有代码 等下回去艘给你稍等 呵呵 很好的代码
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-04-12
展开全部
LZ你想学编程的话我樱羡建议去饭客网络学习,那里有旅颂游专门的版块供大家交流学习,还有许多拆销教程供大家观看,你的问题到那里可以解决·
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询