diff --git a/SelfEducation/Task/T3/float_int_run.c b/SelfEducation/Task/T3/float_int_run.c new file mode 100644 index 0000000..6c4a826 --- /dev/null +++ b/SelfEducation/Task/T3/float_int_run.c @@ -0,0 +1,16 @@ +#include +#include + +int main() +{ + int n1, n2; + float k; + + scanf("%d%f", &n1, &k); + + n2 = k * n1; + + printf("%d\n", abs(n2 - n1)); + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/Task/T3/kupec.c b/SelfEducation/Task/T3/kupec.c new file mode 100644 index 0000000..66ee93b --- /dev/null +++ b/SelfEducation/Task/T3/kupec.c @@ -0,0 +1,16 @@ +#include +#define x 106 + +int main() +{ + int rub, kop, rest, n; + + scanf("%d%d", &rub, &kop); + + n = (rub * 100 + kop) / x; + rest = (rub * 100 + kop) - n * x; + + printf("%d %d\n", n, rest); + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/Task/T3/monday.c b/SelfEducation/Task/T3/monday.c new file mode 100644 index 0000000..2bb725d --- /dev/null +++ b/SelfEducation/Task/T3/monday.c @@ -0,0 +1,14 @@ +#include + +int main() +{ + int day, n, ans; + + scanf("%d%d", &n, &day); + + ans = (n - day) / 7 + 1; + + printf("%d\n", ans); + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/Task/T3/out/float_int_run b/SelfEducation/Task/T3/out/float_int_run new file mode 100755 index 0000000..1d6d4cb Binary files /dev/null and b/SelfEducation/Task/T3/out/float_int_run differ diff --git a/SelfEducation/Task/T3/out/skg b/SelfEducation/Task/T3/out/skg new file mode 100755 index 0000000..aa815ba Binary files /dev/null and b/SelfEducation/Task/T3/out/skg differ diff --git a/SelfEducation/Task/T3/out/t_c_app b/SelfEducation/Task/T3/out/t_c_app new file mode 100755 index 0000000..7b8b450 Binary files /dev/null and b/SelfEducation/Task/T3/out/t_c_app differ diff --git a/SelfEducation/Task/T3/out/task_kupec b/SelfEducation/Task/T3/out/task_kupec new file mode 100755 index 0000000..fad3bd0 Binary files /dev/null and b/SelfEducation/Task/T3/out/task_kupec differ diff --git a/SelfEducation/Task/T3/out/task_monday b/SelfEducation/Task/T3/out/task_monday new file mode 100755 index 0000000..77b3d42 Binary files /dev/null and b/SelfEducation/Task/T3/out/task_monday differ diff --git a/SelfEducation/Task/T3/skg_2.c b/SelfEducation/Task/T3/skg_2.c new file mode 100644 index 0000000..fd8f289 --- /dev/null +++ b/SelfEducation/Task/T3/skg_2.c @@ -0,0 +1,18 @@ +#include + +int main() +{ + int g1, g2, k1, k2, s1, s2, g, s, k, sum; + + scanf("%d%d%d", &g1, &s1, &k1); + scanf("%d%d%d", &g2, &s2, &k2); + + sum = (g1 + g2) * 17 * 29 + (s1 + s2) * 29 + (k1 + k2); + g = sum / (17 * 29); + s = (sum - g * (17 * 29)) / 29; + k = sum - g * (17 * 29) - s * 29; + + printf("%d %d %d\n", g, s, k); + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/Task/T3/town_clock.c b/SelfEducation/Task/T3/town_clock.c new file mode 100644 index 0000000..3f64dba --- /dev/null +++ b/SelfEducation/Task/T3/town_clock.c @@ -0,0 +1,14 @@ +#include + +int main() +{ + int Bell, nBell; + + scanf("%d%d", &Bell, &nBell); + + int sum_arifm_seq = (Bell + nBell) * (nBell - Bell + 1) / 2; + + printf("%d\n", sum_arifm_seq); + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/fahr/func.c b/SelfEducation/Task/T4/fahr/func.c new file mode 100644 index 0000000..7f65bb9 --- /dev/null +++ b/SelfEducation/Task/T4/fahr/func.c @@ -0,0 +1,10 @@ +#include + +float fahr(int cel) +{ + float res; + + res = cel * 9 / 5 + 32; + + return res; +} \ No newline at end of file diff --git a/SelfEducation/Task/T4/fahr/main.c b/SelfEducation/Task/T4/fahr/main.c new file mode 100644 index 0000000..f3152a5 --- /dev/null +++ b/SelfEducation/Task/T4/fahr/main.c @@ -0,0 +1,16 @@ +#include +#include "func.c" + +float fahr(int cel); + +int main() +{ + int cel; // градусы Цельсия + float f; // градусы Фаренгейта + + scanf("%d", &cel); + f = fahr(cel); + printf("%.2f\n", f); // .2f - печатать с точностью до 2 знаков после . + + return 0; +} \ No newline at end of file diff --git a/SelfEducation/first.c b/SelfEducation/first.c new file mode 100644 index 0000000..632294c --- /dev/null +++ b/SelfEducation/first.c @@ -0,0 +1,22 @@ +#include + +// int main(int argv, char argc[]) +// { +// //printf("Hello, world!\n"); +// printf("Good bye\n"); + +// return 2; + +// } + +int main() +{ + int r, t; + + scanf("%d%d", &r, &t); + + printf("%d %d\n", t/r, t-(r*(t/r))); + + return 0; + +} \ No newline at end of file diff --git a/SelfEducation/out/first b/SelfEducation/out/first new file mode 100755 index 0000000..de70962 Binary files /dev/null and b/SelfEducation/out/first differ