下载小熊猫DevC++6.5版本,运行下面这段代码。
#include
#include
#include
using namespace std;
int main()
{
bool t[1920][1080]={};
srand(time(NULL));
initgraph(1920,1080);
while(1) {
int x,y,z;
x=rand()%256;
y=rand()%256;
z=rand()%256;
int p,q;
p=rand()%1920;
q=rand()%1080;
putpixel(p,q,RGB(x,x,x));
//Sleep(2);
}
getch();
return 0;
}(代码第九行自己改窗口大小,不要太大)
以下是效果图。