diff --git a/SelfEducation/Task/T4/6ticket/func.c b/SelfEducation/Task/T4/6ticket/func.c index 8e81eb2..2b116b9 100644 --- a/SelfEducation/Task/T4/6ticket/func.c +++ b/SelfEducation/Task/T4/6ticket/func.c @@ -5,6 +5,7 @@ void print_revers(int x) { int res = 0; + int *p_res = &res; for (int i = N - 1; i > -1; i--) { res += (x / (int)pow(10, i)) * (int)pow(10, (N - 1 - i)); @@ -12,5 +13,5 @@ void print_revers(int x) printf("%d | %d\n", x, res); } - printf("%d\n", res); + printf("%d %ls\n", res, p_res); } \ No newline at end of file diff --git a/SelfEducation/Task/T4/6ticket/out/6t_app b/SelfEducation/Task/T4/6ticket/out/6t_app index 494aea4..2939662 100755 Binary files a/SelfEducation/Task/T4/6ticket/out/6t_app and b/SelfEducation/Task/T4/6ticket/out/6t_app differ diff --git a/SelfEducation/Task/T4/center/func.c b/SelfEducation/Task/T4/center/func.c new file mode 100644 index 0000000..256e6f6 --- /dev/null +++ b/SelfEducation/Task/T4/center/func.c @@ -0,0 +1,17 @@ +#include + +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; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/center/main.c b/SelfEducation/Task/T4/center/main.c new file mode 100644 index 0000000..26753fb --- /dev/null +++ b/SelfEducation/Task/T4/center/main.c @@ -0,0 +1,20 @@ +#include + +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; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/center/out/cent_app b/SelfEducation/Task/T4/center/out/cent_app new file mode 100755 index 0000000..5cffcb8 Binary files /dev/null and b/SelfEducation/Task/T4/center/out/cent_app differ diff --git a/SelfEducation/Task/T4/min2time/func.c b/SelfEducation/Task/T4/min2time/func.c new file mode 100644 index 0000000..78c4d9e --- /dev/null +++ b/SelfEducation/Task/T4/min2time/func.c @@ -0,0 +1,7 @@ +#include + +void min2time(int mm, int *ph, int *pm) +{ + *ph = (mm / 60) % 24; + *pm = (mm - ((mm / 60) % 24) * 60) % 60; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/min2time/main.c b/SelfEducation/Task/T4/min2time/main.c new file mode 100644 index 0000000..a20591c --- /dev/null +++ b/SelfEducation/Task/T4/min2time/main.c @@ -0,0 +1,15 @@ +#include + +void min2time(int mm, int *ph, int *pm); + +int main() +{ + int mm, h, m; + scanf("%d", &mm); + + min2time(mm, &h, &m); + + printf("%02d:%02d\n", h, m); + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/min2time/out/m2t_app b/SelfEducation/Task/T4/min2time/out/m2t_app new file mode 100755 index 0000000..1e0f022 Binary files /dev/null and b/SelfEducation/Task/T4/min2time/out/m2t_app differ diff --git a/SelfEducation/Task/T4/mirror/func.c b/SelfEducation/Task/T4/mirror/func.c new file mode 100644 index 0000000..3cfcda2 --- /dev/null +++ b/SelfEducation/Task/T4/mirror/func.c @@ -0,0 +1,12 @@ +#include + +void mirror(int *px, int *py) +{ + *px = *px * (-1); +} + +void mirror_seg(int *px1, int *py1, int *px2, int *py2) +{ + *py1 *= -1; + *py2 *= -1; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/mirror/main.c b/SelfEducation/Task/T4/mirror/main.c new file mode 100644 index 0000000..05013b8 --- /dev/null +++ b/SelfEducation/Task/T4/mirror/main.c @@ -0,0 +1,24 @@ +#include + +void mirror(int *px, int *py); +void mirror_seg(int *px1, int *py1, int *px2, int *py2); + +int main() +{ + int x1, y1, x2, y2; + int *px1 = &x1, *py1 = &y1; + int *px2 = &x2, *py2 = &y2; + + scanf("%d%d", px1, py1); + scanf("%d%d", px2, py2); + + // mirror(px1, py1); + + // printf("%d %d\n", x1, y1); + + mirror_seg(px1, py1, px2, py2); + + printf("%d %d %d %d\n", x1, y1, x2, y2); + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/mirror/out/m_app b/SelfEducation/Task/T4/mirror/out/m_app new file mode 100755 index 0000000..30616ca Binary files /dev/null and b/SelfEducation/Task/T4/mirror/out/m_app differ diff --git a/SelfEducation/Task/T4/move/func.c b/SelfEducation/Task/T4/move/func.c new file mode 100644 index 0000000..dc21d3b --- /dev/null +++ b/SelfEducation/Task/T4/move/func.c @@ -0,0 +1,7 @@ +#include + +void move(int *px, int *py, int dx, int dy) +{ + *px += dx; + *py += dy; +} diff --git a/SelfEducation/Task/T4/move/main.c b/SelfEducation/Task/T4/move/main.c new file mode 100644 index 0000000..da3cd7d --- /dev/null +++ b/SelfEducation/Task/T4/move/main.c @@ -0,0 +1,17 @@ +#include + +void move(int *px, int *py, int dx, int dy); + +int main() +{ + int x, y, dx, dy; + int *px = &x, *py = &y; + + scanf("%d%d%d%d", px, py, &dx, &dy); + + move(px, py, dx, dy); + + printf("%d %d\n", *px, *py); + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/move/out/move_app b/SelfEducation/Task/T4/move/out/move_app new file mode 100755 index 0000000..79ccd1e Binary files /dev/null and b/SelfEducation/Task/T4/move/out/move_app differ diff --git a/SelfEducation/Task/T4/swap/func.c b/SelfEducation/Task/T4/swap/func.c new file mode 100644 index 0000000..0868fc7 --- /dev/null +++ b/SelfEducation/Task/T4/swap/func.c @@ -0,0 +1,12 @@ +#include + +void swap(int *px, int *py) +{ + int t; + + t = *px; + *px = *py; + *py = t; + + return; +} diff --git a/SelfEducation/Task/T4/swap/main.c b/SelfEducation/Task/T4/swap/main.c new file mode 100644 index 0000000..8425656 --- /dev/null +++ b/SelfEducation/Task/T4/swap/main.c @@ -0,0 +1,14 @@ +#include + +void swap(int *px, int *py); + +int main() +{ + int x, y; + scanf("%d%d", &x, &y); + + swap(&x, &y); + + printf("%d %d\n", x, y); + return 0; +} diff --git a/SelfEducation/Task/T4/swap/out/swap_app b/SelfEducation/Task/T4/swap/out/swap_app new file mode 100755 index 0000000..52c6004 Binary files /dev/null and b/SelfEducation/Task/T4/swap/out/swap_app differ