c++实现的图(graph)的算法,怎么能可视化演
1个回答
2017-12-10 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:117538
获赞数:517194
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。
向TA提问 私信TA
关注
展开全部
#pragma comment(lib,"user32")#pragma comment(lib,"gdi32")#include <stdio.h>#include <stdlib.h>#include <windows.h>HWND WINAPI GetConsoleWindow();void HideTheCursor() { CONSOLE_CURSOR_INFO cciCursor; HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); if(GetConsoleCursorInfo(hStdOut, &cciCursor)) { cciCursor.bVisible = FALSE; SetConsoleCursorInfo(hStdOut, &cciCursor); }}void ShowTheCursor() { CONSOLE_CURSOR_INFO cciCursor; HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); if(GetConsoleCursorInfo(hStdOut, &cciCursor)) { cciCursor.bVisible = TRUE; SetConsoleCursorInfo(hStdOut, &cciCursor); }}int main() { HWND hwnd; HDC hdc; HFONT hfont; system("color F0"); system("cls"); HideTheCursor(); hwnd = GetConsoleWindow(); hdc = GetDC(hwnd); hfont = CreateFont(48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "华文楷体"); SelectObject(hdc,hfont); TextOut(hdc,10,10,"地球人都知道!",14); MoveToEx(hdc,5,5,NULL); LineTo(hdc,300, 5); LineTo(hdc,300, 60); LineTo(hdc, 5, 60); LineTo(hdc, 5, 5); DeleteObject(hfont); ReleaseDC(hwnd,hdc); getchar(); system("color 07"); system("cls"); ShowTheCursor(); return 0;}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询