在玩c++的EasyX的时候想输出文字,在官方文档里看见了这个
第一第二都填了100,第三不知道要填什么,我就乱填了一下,然后运行就变成了这样(哭)删了显示文字的代码还是这样,我还试了把全部代码复制后放在另一个文件,可还是这样?!??
我有一点不知所措...
这是我的代码,请帮帮我!!!
#include <stdio.h>
#include <easyx.h>
#include <mmsystem.h>
#include <cstdlib>
#include <graphics.h>
#include <conio.h>
#include <string>
#include <Windows.h>
#include <iostream>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
void yjjx(int xx, int yy, int c, int k, int j) {
fillroundrect(xx + (0 - c / 2), (yy + (k / 2)), (xx + (c / 2)), (yy + (0 - k / 2)), j, j);
}
using namespace std;
int main() {
int sx = 0, sy = 0;
settextcolor(RGB(0, 0, 0));
initgraph(800, 600);
setorigin(400, 300);
setaspectratio(1, -1);
setbkcolor(RGB(11, 206, 255));
setfillcolor(RGB(11, 133, 255));
while (1) {
Sleep(100);
cleardevice();
if (KEY_DOWN('W')) {
sy++;
}
if (KEY_DOWN('S')) {
sy--;
}
yjjx(0, 100, 200, 90, 15);
yjjx(0, 0, 200, 90, 15);
yjjx(0, -100, 200, 90, 15);
yjjx(0, -200, 200, 90, 15);
}
}