当前位置:网站首页>第二十章:y= sin(x)/x,漫步坐标系计算,y= sin(x)/x 带廓幅图形,奥运五环,小球滚动与弹跳,流水显示,矩形优化裁剪,r个皇后全控nxn棋盘
第二十章:y= sin(x)/x,漫步坐标系计算,y= sin(x)/x 带廓幅图形,奥运五环,小球滚动与弹跳,流水显示,矩形优化裁剪,r个皇后全控nxn棋盘
2022-07-03 19:16:00 【股_四】
一、前期准备
在VS2017中,没有<graphics.h>这个库文件
下载一个软件:https://easyx.cn/

//y= sin(x)/x
int main()
{
double t, x;
int k, r, y;
initgraph(640, 480);
setfillcolor(YELLOW);//初始化 640x480 的绘图屏幕
fillrectangle (50, 20, 570, 320) ; //设置背景
setcolor (BLACK) ;
line (50, 200, 550, 200) ;
line (300, 280, 300, 50) ; //画坐标轴直线
for (r = 1; r <= 5; r = r + 1)
{
line(540, 195, 550 - r, 200);
line(540, 205, 650 - r, 200);
line(295, 60, 300, 50 + r);
line(305, 60, 300, 50 + r);
}
circle(305, 205, 3);
t = 220 / 4 / 3.1415926;
for (k = 80; k <= 520; k = k + 1) //通过画圆显示图形
{
x = (k - 300) / t;
y = (int)(200 - 120 * sin(x) / x);
setcolor(GREEN);
setfillcolor(GREEN);
for (r = 1; r <= 2; r++)
fillcircle(k, y, r);
Sleep(30); //延时
}
_getch();
closegraph();
return 0;
}
结果:
//漫步坐标系计算
int main()
{
long d, j, k, n, s, x, y, z;
printf(" 1步数->坐标;2坐标->步数;请选择计算项目");
scanf("%d", &z);
if (z==1)
{
printf("步数->坐标,请输入步数n:");
scanf ("%ld", &n);
s=k=0;
while (1)
{
k++;
s += 2 * k;
d = s - n;
if (abs(d) <= k) break; //确定第n步所在层数k
}
if (k % 2 > 0 && d < 0)
{
x = k;
y = k + d;
} // 奇数层坐标赋值
else if (k%2>0 && d>=0)
{
x = k - d;
y = k;
}
else if (k % 2 == 0 && d<0)
{
x = k + d; y = k; //偶数层坐标赋值
}
else if (k % 2 == 0 && d >= 0)
{
x = k;
y = k - d;
}
printf(" 第%1d 步所到位置坐标:%1d,%1d)。\n", n, x, y);
}
else
{
printf(" 坐标->步数,请输入坐标 x,y:");
scanf( "%d", &x);
printf("x= %ld", x);
scanf("%d", &y);
//scanf("%1d,%ld", &x,&y);
// printf("x= %ld", x);
printf("y =%ld", y);
k = (x > y ? x : y); // 求取x、,的最大值k 即层:
s = 0;
for (j = 1; j <= k; j++)
s = s + 2 * j;
if (k % 2 > 0) //求取k层折点的步数s //奇数层先水平向右,再垂直
{
if (x == k)
n = s + (k - y);
else
n = s - (k - x);
}
else // 偶数层先垂直向上,再水平
{
if (x == k)
n = s - (k - y);
else
n = s + (k - x);
}
printf("漫步到坐标(%ld,%ld) 是第 %ld 步 \n", x, y, n);
}
return 0;
}
结果:
附言:在VC2017中,使用scanf(“%ld”,&x);总是失败,需要改成scanf(“%d”,&x);
//y= sin(x)/x 带廓幅图形
int main()
{
double t, x;
int k, r, y,h;
initgraph(640, 480);
setfillcolor(YELLOW);//初始化 640x480 的绘图屏幕
fillrectangle(50, 20, 570, 320); //设置背景
setcolor(BLACK);
line(50, 200, 550, 200);
line(300, 280, 300, 50); //画坐标轴直线
for (r = 1; r <= 5; r = r + 1)
{
line(540, 195, 550 - r, 200);
line(540, 205, 650 - r, 200);
line(295, 60, 300, 50 + r);
line(305, 60, 300, 50 + r);
}
circle(305, 205, 3);
t = 220 / 4 / 3.1415926;
for (k = 80; k <= 520; k = k + 1) //通过画圆显示图形
{
x = (k - 300) / t;
y = (int)(200 - 120 * sin(x) / x);
h = (int)(1 + 12 * fabs(sin(x) / x));
setcolor(CYAN);
setfillcolor(CYAN);
fillellipse(k - 1, y - h, k + 1, y + h);
//for (r = 1; r <= 2; r++)
// fillcircle(k, y, r);
Sleep(30); //延时
}
_getch();
closegraph();
return 0;
}
结果:
//奥运五环
int main()
{
int k, i, x, y;
initgraph(640, 180);
setfillcolor(LIGHTGREEN);
bar(50, 40, 430, 240);
setlinestyle(PS_SOLID, 3);
x = 150;
y = 120;
for (i = 0; i <= 4; i++)
{
if (i == 0)
setcolor(BLUE); // 作图初始化,清屏 / 画一面矩形旗帜 //调粗面笔 // 循环5次,画5个环 /定义各环画笔颜色
else if (i == 1)
setcolor(BLACK);
else if (i == 2) setcolor(RED);
else if (i == 3) setcolor(YELLOW);
else setcolor(GREEN);
if (i > 2)
{
x = -75; y = 160;
}
for (k = 0; k <= 8; k++)
circle(x + i * 90, y, 42 - k);
Sleep(1000); //调整下面两个环的圆心 // 每个环画多个同心圆加粗 //适当延时
}
for (k = 0; k <= 8; k++) //局部调整使各环相扣
{
setcolor(BLUE);
arc(150 - 42 + k, 120 - 42 + k, 150 + 42 - k, 120 + 42 - k, 5.8, 7.0);
setcolor(BLACK);
arc(240 - 42 + k, 120 - 42 + k, 240 + 42 - k, 120 + 42 - k, 3.8, 4.7);
arc(240 - 42 + k, 120 - 42 + k, 240 + 42 - k, 120 + 42 - k, 5.8, 7.0);
setcolor(RED);
arc(330 - 42 + k, 120 - 42 + k, 330 + 42 - k, 120 + 42 - k, 3.8, 6.0);
}
_getch();
closegraph();
return 0;
}
结果:
//小球滚动与弹跳
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <math.h>
#include <conio.h>
#include <graphics.h>
int main()
{
int k, n, x, y;
double h = 300;
double v = 0;
double a = 9.8 / 50;
initgraph(640, 480);
setfillcolor(YELLOW);
fillrectangle(50, 20, 600, 470);
setcolor(BLUE);
setfillcolor(CYAN);
fillrectangle(80, 455, 540, 427); //设罝高度 //设置初速度 1/确定加速度 //初始化绘图窗口 //设置背景 // 画地平面
setfillcolor (BROWN) ;
setlinestyle (PS_SOLID, 3) ;
fillrectangle(100, 120, 372, 100);//画桌面
fillrectangle (300, 120, 325, 425) ;
fillrectangle (150, 120, 175, 425) ;
for (x = 120; x <= 372; x = x + 2)
{
setcolor(GREEN);
setfillcolor(GREEN);
fillcircle(x, 72, 25); //画有边框的绿色填充圆
if (x == 120) Sleep(2000);
Sleep(20); //延时
setcolor(YELLOW);
setfillcolor(YELLOW);
//及时消除痕迹
fillcircle(x, 72, 25);
}
for (k = 1; k <= 14; k++)
{
x = 2 * k;
y = (int)sqrt(25 * 25 - x * x);
setcolor(GREEN);
setfillcolor(GREEN);
fillcircle(373 + x, 94 - y, 25);
Sleep(20);
setcolor(YELLOW);
setfillcolor(YELLOW);
fillcircle(373 + x, 94 - y, 25);
}
n = 0;
while (n <= 18)
{
v += a;
h -= (v - a / 2);
if (h <= 0)
{
n++;
h += (v - a / 2);
v = -v * 0.85;
printf("\a");
}
setcolor(GREEN);
setfillcolor(GREEN);
fillcircle(400, 400 - int(h), 25);
Sleep(20);
setcolor(YELLOW);
setfillcolor(YELLOW);
fillcircle(400, 400 - int(h), 25);
}
setcolor(GREEN);
setfillcolor(GREEN);
fillcircle(400, 400, 25);
_getch();
closegraph();
return 0;
}
结果:
//流水显示
#include <stdio.h>
#include <math.h>
#include <conio.h>
#include <graphics.h>
int main()
{
int d, d1, d2, i, j, k, t, x, y, x1, y1;
initgraph(640, 480);
rectangle(50, 30, 248, 348);
rectangle(18, 30, 250, 350);
setfillcolor(BROWN);
bar(30, 25, 77, 35);
bar(63, 25, 77, 60);
bar(30, 25, 40, 472);
bar(40, 162, 50, 472);
bar(248, 202, 260, 206);
rectangle(255, 202, 258, 194);
bar(253, 194, 260, 190);
bar(248, 344, 260, 348);
rectangle(255, 336, 258, 344);
bar(253, 336, 260, 332);
bar(2, 351, 250, 370);
line(50, 374, 50, 472);
line(50, 472, 620, 472);
line(620, 472, 620, 374);
setfillcolor(GREEN);
fillpie(30, 0, 45, 30, 0, 6.29);
for (k = 1; k<= 2; k++)
{
setfillcolor(GREEN);
bar(51, 378, 618, 471);
t = _getch();
bar(67, 60, 72, 347);
for (y = 347; y >= 60; y--)
{
fillpie(30, 0, 45, 30, 0, -y * 10);
for (x = 51; x <= 247; x++)
putpixel(x, y, GREEN);
for (x = 51; x <= 619; x++)
putpixel(x, 375 + (350 - y) / 3, BLACK);
Sleep(20);
}
t = _getch();
for (y = 60; y <= 347; y++) //按任意键流水
{
for (x = 51; x <= 247; x++)
putpixel(x, y, BLACK);
if (y <= 203)
for (j = 0; j <= 264; j++)
{
d = (int)sqrt(204 - y);
d1 = (int)(2 * sqrt(j) *d);
d2 = (int)(2 * sqrt(j + 1) *d);
x1 = 260 + d1;
y1 = 204 + j;
d = d2 - d1 + (204 - y) / 70;
setfillcolor(GREEN);
// d、dl. d2控制地物线
for (i = 0; i <= d; i++) //上孔流水
if ((x1 + i) < 618 && y1 < 490 - y / 3)
solidcircle(x1 + i, y1, 1);
}
for (j = 0; j <= 120; j++)
{
d = (int)sqrt(348 - y);
d1 = (int)(2 * sqrt(j) *d);
d2 = (int)(2 * sqrt(j + 1) *d);
x1 = 260 + d1;
y1 = 346 + j; d = d2 - d1 + (348 - y) / 70;
setfillcolor(GREEN);
for (i = 0; i <= d; i++)
if (y1 < 490 - y / 3 && x1 + i < 618)
solidcircle(x1 + i, y1, 1);
}
if (y % 3 == 0)
for (x = 51; x <= 619; x++)
putpixel(x, 491 - y / 3, GREEN); // 下槽水位升高
Sleep(50);
setfillcolor(BLACK);
solidrectangle(260, 200, 618, 490 - y / 3);// 清除水流痕迹
}
}
_getch();
closegraph();
return 0;
}
结果:
//矩形优化裁剪
#ifndef _CRT_SECURE_NO_WARNINGS //一定要使用,不然scanf是编译不通过
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "list.h"
#include <math.h>
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void pra(int a, int b);
int pro(int a, int b);
//矩形优化剪切
int ln, w, a, b, d, x, y, x1, y11, x2, y2, x3, y3, x4, y4, max;
long n, min;
int main()
{
void pra (int a, int b);
int pro (int a, int b) ;
int max1, max2, t, i, wmin, lmin, dw, dl;
printf("输入大矩形边长 ln, w = ");
scanf("%d,%d", &ln, &w);
printf("输入小矩形边长 a, b = ");
scanf("%d,%d", &a, &b);
if (ln < w) {
t = ln; ln = w; w = t; }
if (a < b) {
t = a; a = b; b = t; }
if (ln >= a && w >= b)
{
wmin = w;
lmin = ln;
for (i = 0; i <= w / a; i++)
{
dw = w - i * a - ((w - i * a) / b) * b;
if (dw < wmin) wmin = dw;
}
for (i = 0; i <= ln / a; i++)
{
dl = ln - i * a - ((ln - i * a) / b) * b;
}
if (dl < lmin) lmin = dl;
if (lmin != 0 || wmin != 0)
min = (long)wmin * ln + lmin * w - wmin * lmin;
else
min = (long)ln * w - ((long)ln * w) / (a * b) * a * b;
n = (long)(ln - lmin) * (w - wmin);
n = n / ((long)a * b);
max1 = pro(a, b);
max2 = pro(b, a);
if (max1 >= max2)
{
pro(a, b);
pra(a, b);
}
else
{
pro(b, a);
pra(b, a);
}
}
else
printf("无法剪切!\n");
return 0;
}
int pro(int a, int b)
{
int l1, w1, s, i, j, i1, j1, i2, j2, i3, j3, i4, j4;
max = 0;
for (i = ln / a; i >= 0; i--)
{
for (j = w / b; j >= 0; j--)
{
for (i3 = 0; i3 <= ln / a - 1; i3++)
{
for (j3 = 0; j3 <= w / b; j3++)
{
i1 = (ln - i * a) / b;
j1 = (w - j3 * b) / a;
i2 = (ln - 13 * a) / b;
j2 = (w - j * b) / a;
s = i * j + i1 * j1 + i2 * j2 + i3 * j3;
l1 = (i1 + 12) * b - ln;
w1 = (j1 + j2) * a - w;
i4 = 0;
j4 = 0;
if (11 > 0 && w1 > 0 && i1 * j1 > 0 && 12 * j2 > 0)
{
i4 = 11 / b;
j4 = 11 / a;
if (l1 % b != 0) i4++;
if (w1 % a != 0) j4++;
s = s - i4 * j4;
}
if (s > max)
{
max = s;
x = i;
x1 = i1;
x2 = i2;
x3 = i3;
x4 = i4;
y = j;
y11 = j1;
y2 = j2;
y3 = j3;
y4 = j4;
}
}
}
}
}
return max;
}
void pra(int a, int b)
{
int i, j, t, f, g;
initgraph(640, 180);
printf("矩形剪切问题:在%dx%d的矩形板面上", ln, w);
printf("剪切 % dx % d的小矩形。\n", a, b);
printf("剪切小矩形个数的上界为:%1d个", n);
printf("按图示可剪切%d个小距形:\n", max);
if (ln > 560 || w > 400)
{
t = ln / 560;
f = w / 400;
g = f + 1;
if (t > f)
g = t + 1;
ln = ln / g;
w = w / g;
a = a / g;
b = b / g;
}
setfillcolor(YELLOW);
bar(60, 60, 60 + ln, 60 + w);
setfillcolor(BROWN);
printf("按图示可剪切 % d 个小矩形:/n", max);
if (ln > 560 || w > 400) // ,尺寸太大时图形按比例缩小
{
t = ln / 560;
f = w / 400;
g = f + 1;
if (t > f)
g = t + 1;
ln = ln / g;
w = w / g;
a = a / g;
b = b / g;
}
setfillcolor(YELLOW);
bar(60, 60, 60 + ln, 60 + w); //黄色填充材料大矩形 //棕色填充剪切小矩形
setfillcolor(BROWN);
for (i = 1; i <= x; i++)
for (j = 1; j <= y; j ++)
bar(61 + (i - 1) * a, 61 + (j - 1) * b, 59 - i * a, 59 + j * b);
for (i = 1; i <= x3; i++)
for (j = 1; j <= y3; j++)
bar(59 + ln - (i - 1) * b, 59 + w - (j - 1) * b, 61 + ln - i * a, 61 + w - j * b);
for (i = 1; i <= x1; i++)
for (j = 1; j <= y11; j ++)
bar(59 + ln - (i - 1) * b, 61 + (j - 1) * a, 61 + ln - i * b, 59 + j * 0);
for (i = 1; 1 <= x2; i++)
for (j = 1; j <= y2; j++)
if (!(x4 * y4 > 0) && i > x2 - x4 && j > y2 - y4)
bar(61 + (i - 1) * 6, 59 + w - (j - 1) * a, 59 + i * b, 61 + w - j * a);
_getch();
closegraph();
}
//
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <math.h>
#include <conio.h>
#include <graphics.h>
void pra(int n);
int p(int k);
int g();
//r个皇后全控nxn棋盘
int r, m, n, a[30];
long s = 0;
int main()
{
int p(int k);
printf(" R个皇后全nxn棋盘,请输入r,n");
scanf("%d,%d",&r,&n);
printf("第m个解输出图形,请确定m");
scanf("%d", &m); // 调用从第1个数开始
p(1);
printf("\n %d 个星后全控 %d x %d棋盘,共以上%ld个解。\n", r, n, n, s);
return 0;
}
//皇后全控递归函数
int p(int k)
{
int h, i, j, u;
int g();
pra(n);
if (k <= n)
{
for (i = 0; i < -n; i++)
{
a[k] = i;
for (u = 0, j = 1; j <= k - 1; j++)
if (a[j] != 0 && a[k] == a[j] || a[k] * a[j] > 0 && abs(a[k] - a[j]) == k - j)
u = 1;// 若出现非零元素相同或同斜行期
if (u == 0) //若第k数可置i,期检测是否n个数 Lif(fe = n)
{
if(k ==n)
{
for (h = 0, j = 1; j <= n; j++)
if (a[i] == 0) h++;
if (h == n - r)
{
if (g() == 0)
{
s++;
printf("");
for (j = 1; j <= n; j++)
printf("%d", a[j]);
if (s % 5 == 0)
printf("\n");
if (s == m) pra(n); // 输出图形解
}
}
}
else p(k + 1);
}
}
}
return s; //检测棋盘是否全控函数
}
int g()
{
int c, f, j, t, b[20][20];
t = 0;
for (c = 1; c <= n; c++)
for (j = 1; j <= n; j++)
b[c][j] = 0;
for (f = 1; f <= n; f++)
{
if (a[f] != 0)
{
for (j = 1; j <= n; j++)
{
b[f][j] = 1;
b[j][a[f]] = 1;
if (f + abs(a[f] - j) <= n)
b[f + abs(a[f] - j)][j] = 1;
if (f - abs(a[f] - j) >= 1)
b[f - abs(a[f] - j)][j] = 1;
}
}
}
for (c = 1; c <= n; c++)
for (j = 1; j <= n; j++)
if (b[c][j] == 0)
{
t = 1;
c = n;
break;
}
return t;//棋盘中有一格不能控制。
}
//r个皇后全控 nxn 棋盤图形函数
void pra (int n)
{
int c,d;
initgraph (640, 480) ;
setcolor (BROWN) ; //画棋盘边框
setlinestyle (PS_SOLID, 1) ;
rectangle(160, 20, 161 + n * 46, 20 + n * 40);
rectangle(158, 18, 163 + n * 16, 22 + n * 40);
for (c=1;c<=n;c++)
for (d = 1; d <= n; d++)
{
setcolor(BLACK); //画棋盘方格
if ((c + d) % 2 == 0)
setfillcolor(WHITE);
else
setfillcolor(CYAN); //棋盘格相间填充
bar(160 + (d - 1) * 46, 20 + (c - 1) * 40, 160 + d * 46, 20 * c * 40);
Sleep(200); //适当延时
if (a[c] == d) //面该行的皇后冠
{
rectangle(123 + d * 46, c * 40, 151 + d * 46, 5 + c * 40);
Sleep(100);
rectangle(123 + d * 46, 5 + c * 10, 151 + d * 16, 10 + c * 10);
Sleep(100);
line(123 + d * 46, c * 40, 118 + d * 16, c * 40 - 10);
line(129 + d * 46, c * 40, 118 + d * 46, c * 40 - 10);
Sleep(100);
line(129 + d * 46, c * 40, 133 + d * 46, c * 40 - 10);
line(137 + d * 16, c * 40, 133 + d * 46, c * 40 - 10);
Sleep(100);
line(137 + d * 16, c * 40, 141 + d * 46, c * 40 - 10);
line(145 + d * 46, c * 40, 141 + d * 16, c * 40 - 10);
Sleep(100);
line(145 + d * 16, c * 40, 156 + d * 16, c * 10 - 10);
line(151 + d * 46, c * 40, 156 + d * 46, c * 40 - 10);
Sleep(100);
}
}
_getch();
closegraph();
}
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <math.h>
#include <conio.h>
#include <graphics.h>
#include "function.h"
void pra(int n, int m);
//int p(int k);
int g();
//r个皇后全控nxm棋盘
int m, n, a[20];
//long s = 0;
int main()
{
int i, h, k, d, j, p, r, s, x;
printf(" R个皇后全nxm棋盘,请输入n,m");
scanf("%d,%d", &n, &m);
printf("%d %d", n, m);
printf("R个皇后控制,请输入R R <= N,M");
scanf("%d", &r);
printf("第p个解输出图形,请确认P");
scanf("%d", &p);
i = 1;
s = 0;
a[1] = 0;
while (1)
{
d = 1;
for (k = i - 1; k >= 1; k--)
{
x = a[i] - a[k];
if (a[k] != 0 && x == 0 || a[i] * a[k] > 0 && abs(x) == i - k)
d = 0;
// printf("1\r\n");
}
if (i == n && d == 1)
{
h = 0;
for (j = 1; j <= n; j++)
if (a[j] == 0)
h++;
if (h == n - r)
{
if (g() == 0)
{
s++;
for (j = 1; j <= n; j++)
printf("%d", a[j]);
printf(" ");
if (s % 5 == 0)
printf("\n");
if (s == p) pra(n, m); // 输出图形解
}
}
}
if (i < n && d == 1)
{
//printf("2\r\n");
i++;
a[i] = 0;
continue;
}
while (a[i] == m && i > 1)
{
i--;
//printf("%d\r\n", i);
}
if (a[i] == m && i == 1)
{
printf("跳出while");
break;
}
else
a[i] = a[i] + 1;
}
if (s > 0)
printf("%d 个皇后控制%d x %d 棋盘,共有以上 %d个解", r, n, m, s);
else
printf("该问题无解");
if (p > s)
printf("无法输出图形解");
}
int g()
{
//printf("调用G");
int c, f, j, t, b[20][20];
t = 0;
for (c = 1; c <= n; c++)
for (j = 1; j <= m; j++)
b[c][j] = 0;
for (f = 1; f <= n; f++)
if (a[f] != 0)
{
for (c = 1; c <= n; c++)
b[c][a[f]] = 1;
//b[j][a[f]] = 1;
for (j = 1; j <= m; j++)
{
b[f][j] = 1;
if (f + abs(a[f] - j) <= n)
b[f + abs(a[f] - j)][j] = 1;
if (f - abs(a[f] - j) >= 1)
b[f - abs(a[f] - j)][j] = 1;
}
}
for (c = 1; c <= n; c++)
for (j = 1; j <= m; j++)
if (b[c][j] == 0)
//{
t = 1;
// c = n;
//break;
//}
return t;//棋盘中有一格不能控制。
}
//r个皇后全控 nxn 棋盤图形函数
void pra(int n, int m)
{
//printf("调用图形");
int c, j;
initgraph(640, 480);
setcolor(BROWN); //画棋盘边框
setlinestyle(PS_SOLID, 2);
rectangle(156, 16, 164 + m * 46, 24 + n * 40);
rectangle(158, 18, 162 + m * 46, 22 + n * 40);
for (c = 1; c <= n; c++)
for (j = 1; j <= m; j++)
{
setcolor(BLACK); //画棋盘方格
if ((c + j) % 2 == 0)
setfillcolor(WHITE);
else
setfillcolor(CYAN); //棋盘格相间填充
bar(160 + (j - 1) * 46, 20 + (c - 1) * 40, 160 + j * 46, 20 * c * 40);
Sleep(200); //适当延时
if (a[c] == j) //面该行的皇后冠
{
setfillcolor(BLUE);
bar(123 + j * 46, c * 40, 151 + j * 46, 5 + c * 40);
// Sleep(100);
setfillcolor(RED);
bar(123 + j * 46, 5 + c * 40, 151 + j * 46, 10 + c * 40);
// Sleep(100);
line(123 + j * 46, c * 40, 118 + j * 46, c * 40 - 10);
line(129 + j * 46, c * 40, 118 + j * 46, c * 40 - 10);
// Sleep(100);
fillcircle(118 + j * 46, c * 40 - 10, 2);
line(129 + j * 46, c * 40, 133 + j * 46, c * 40 - 10);
line(137 + j * 16, c * 40, 133 + j * 46, c * 40 - 10);
fillcircle(133 + j * 46, c * 40 - 10, 2);
// Sleep(100);
line(137 + j * 16, c * 40, 141 + j * 46, c * 40 - 10);
line(145 + j * 46, c * 40, 141 + j * 16, c * 40 - 10);
fillcircle(141 + j * 46, c * 40 - 10, 2);
// Sleep(100);
line(145 + j * 16, c * 40, 156 + j * 16, c * 10 - 10);
line(151 + j * 46, c * 40, 156 + j * 46, c * 40 - 10);
fillcircle(156 + j * 46, c * 40 - 10, 2);
// Sleep(100);
}
}
_getch();
closegraph();
}
``
结果:


边栏推荐
- I didn't cancel
- DriveSeg:动态驾驶场景分割数据集
- Find the median of two positive arrays
- leetcode:11. 盛最多水的容器【雙指針 + 貪心 + 去除最短板】
- Web Security (VIII) what is CSRF attack? Why can token prevent csdf attacks?
- Flutter网络和数据存储框架搭建 -b1
- application
- 利用可视化结果,点击出现对应的句子
- SQL injection for Web Security (1)
- Valentine's Day - make an exclusive digital collection for your lover
猜你喜欢

我们做了一个智能零售结算平台

【LeetCode】【SQL】刷题笔记

【疾病识别】基于matlab GUI机器视觉肺癌检测系统【含Matlab源码 1922期】

Record: writing MySQL commands

Flume learning notes

我們做了一個智能零售結算平臺
![Failed to start component [StandardEngine[Catalina]. StandardHost[localhost]. StandardContext](/img/56/ea61359dd149a49589ba7ad70812a0.jpg)
Failed to start component [StandardEngine[Catalina]. StandardHost[localhost]. StandardContext

Free year-end report summary template Welfare Collection

We have built an intelligent retail settlement platform

OSPF - detailed explanation of stub area and full stub area
随机推荐
Redis master-slave synchronization, clustering, persistence
235. 二叉搜索树的最近公共祖先【lca模板 + 找路径相同】
为什么要做特征的归一化/标准化?
The online customer service system developed by PHP is fully open source without encryption, and supports wechat customer service docking
Dynamic planning -- expansion topics
What is the content of game modeling
User identity used by startup script and login script in group policy
Luogu-p1107 [bjwc2008] Lei Tao's kitten
【学术相关】顶级论文创新点怎么找?中国高校首次获CVPR最佳学生论文奖有感...
Succession of flutter
利用可视化结果,点击出现对应的句子
The necessity of lean production and management in sheet metal industry
Bad mentality leads to different results
Analysis of dart JSON encoder and decoder
Basic principle of LSM tree
cipher
How to design a high concurrency system
The installation path cannot be selected when installing MySQL 8.0.23
Day18 - basis of interface testing
leetcode:11. 盛最多水的容器【双指针 + 贪心 + 去除最短板】