代码拉取完成,页面将自动刷新
#define _CRT_SECURE_NO_WARNINGS
#include <conio.h>
#include <graphics.h>
#include <conio.h>
#include <math.h>
#define High 480
#define Width 640
#definePiI 3.14159
int main()
{
initgraph(Width, High);
int center_x, center_y;
center_x = Width / 2;
center_y = High / 2;
int secondLength;
secondLength = Width / 5;
int secondEnd_x, secondEnd_y;
float secondAngle = 0;
while(1)
{
secondEnd_x = center_x + secondLength * sin(secondAngle);
secondEnd_y = center_y - secondLendth * cos(secondAngle);
setlinestyle(PS_SOLID, 2);
setcolor(WHITE);
line(center_x, center_y, secondEnd_x, secondEnd_y);
sleep(100);
setcolor(BLACK);
line(center_x, center_y, secondEnd_x, secondEnd_y);
secondAngle = secondAngle * 2 * PI / 60;
}
getch();
closegraph();
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。