/*
#include<stdio.h>
#include<math.h>
struct Point2D{
int x;
int y;
};
int main()
{
struct Point2D p1;
struct Point2D p2;
p1.x=30;
p1.y=20;
p2.x=60;
p2.y=50;
int a = p2.x - p1.x;
int b = p2.y - p1.y;
double c = sqrt((a*a) + (b*b));
printf("%f\n",c);
return 0;
}
*/
/*
#include<stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <time.h>
#include<math.h>
void move(int x, int y)
{
struct Point2D
int x;
int y;
COORD Cur;
Cur.X = x;
Cur.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Cur);
}
int main()
{
int n;
n=75;
for (int i=1; i<=n; i++)
{
for (int j=1; j<=n; j++)
{
if(j==1 || i==1 || i==n || j==n || i==j || i==n-j+1 || n/2+1==i || n/2+1==j)
printf("*");
else
printf(" ");
}
printf("\n");
}
int x=10,y=5;
int x2=50,y2=4;
char key;
move(x2,y2);
printf("▣");
move(x,y);
printf("┌┐");
srand(time(NULL)); // keep
while(1)
{
struct Point2D p1;
struct Point2D p2;
p1.x=x;
p1.y=y;
p2.x=x2;
p2.y=y2;
int a = p2.x - p1.x;
int b = p2.y - p1.y;
double c = sqrt((a*a) + (b*b));
key = _getch();
move(x,y);
printf(" ");
if(key=='w')
{
y--;
}
else if(key=='a')
{
x--;
}
else if(key=='s')
{
y++;
}
else if(key=='d')
{
x++;
}
else if(key=='q')
{
printf("*");
}
if(x==5 && y==5)
{
return 0;
}
move(x,y);
move()
printf("┌┐");
move(20,10);
}
}
*/