回覆列表
  • 1 # 網上的跳蚤

    c語言控制檯在指定位置輸出字元程式碼演示如下:#include <windows.h>void PrintChar(char *ch,UINT count,UINT x,UINT y) //在座標(x,y)處輸出字串ch,ch裡有count個字元{ HANDLE h=GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; ULONG unuse; pos.X=x; pos.Y=y; CONSOLE_SCREEN_BUFFER_INFO bInfo; // 視窗緩衝區資訊 GetConsoleScreenBufferInfo(h, &bInfo ); WriteConsoleOutputCharacterA(h,ch,count,pos,&unuse);}int main(){ PrintChar("123",3,2,2); return 0;}

  • 2 # 湯圓電影Vlog

    1.gotoxy函式: 原型:extern void gotoxy(int x, int y); 用法:#include <system.h> 功能:將游標移動到指定位置說明:gotoxy(x,y)將游標移動到指定行y和列x。設定游標到文字螢幕的指定位置,其中引數x,y為文字螢幕的座標。 gotoxy(0,0)將游標移動到螢幕左上角2.例程(下面這個例子將在螢幕中央輸出“hello world”):

    #include <conio.h> int main(){ clrscr(); //清除螢幕 gotoxy(35, 12); //挪動滑鼠到螢幕中央 cputs("Hello world"); getch(); return 0; }

  • 中秋節和大豐收的關聯?
  • 三十而嫁大結局?