This commit is contained in:
ada-dmitry
2023-11-18 21:17:47 +03:00
parent 1bbd6527b8
commit a3c32e3438
17 changed files with 147 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
#include <stdio.h>
void center(int xlt, int ylt, int xrb, int yrb, int *pxc, int *pyc)
{
*pxc = (xlt + xrb) / 2;
*pyc = (ylt + yrb) / 2;
}
void rotateC(int *x1, int *y1, int *x2, int *y2)
{
int t1 = *x1, t2 = *x2;
*x1 = *y2;
*x2 = *y1;
*y1 = t2;
*y2 = t1;
}
+20
View File
@@ -0,0 +1,20 @@
#include <stdio.h>
void center(int xlt, int ylt, int xrb, int yrb, int *pxc, int *pyc);
void rotateC(int *x1, int *y1, int *x2, int *y2);
int main()
{
int xlt, ylt, xrb, yrb, xc, yc;
int *pxc = &xc, *pyc = &yc;
scanf("%d%d%d%d", &xlt, &ylt, &xrb, &yrb);
center(xlt, ylt, xrb, yrb, pxc, pyc);
rotateC(&xlt, &ylt, &xrb, &yrb);
printf("%d %d %d %d\n", xlt, ylt, xrb, yrb);
return 0;
}
Binary file not shown.