diff --git a/components/mdx-components.tsx b/components/mdx-components.tsx index 3f3818a..e9fcde3 100644 --- a/components/mdx-components.tsx +++ b/components/mdx-components.tsx @@ -6,6 +6,7 @@ import { Callout } from '@/components/callout'; import { CodeBlock } from '@/components/code-block'; import { TableOfContents } from '@/components/table-of-contents'; import { Video } from '@/components/video'; +import { YouTube } from '@/components/youtube'; import { cn } from '@/lib/utils'; /** @@ -84,4 +85,4 @@ function pre({ children }: React.HTMLProps) { return {children}; } -export const MDXComponents = { a, p, img, pre, TableOfContents, Callout, Video }; +export const MDXComponents = { a, p, img, pre, TableOfContents, Callout, Video, YouTube }; diff --git a/components/video.tsx b/components/video.tsx index e081bd7..213c24d 100644 --- a/components/video.tsx +++ b/components/video.tsx @@ -1,8 +1,3 @@ -import { useState } from 'react'; -import { Bookmark, ChevronDown } from 'lucide-react'; - -import { cn } from '@/lib/utils'; - type TableOfContentsProps = { children: React.ReactNode; title: string; @@ -10,7 +5,6 @@ type TableOfContentsProps = { }; export function Video({ children, title, src }: TableOfContentsProps) { - return (
diff --git a/components/youtube.tsx b/components/youtube.tsx new file mode 100644 index 0000000..afb67fb --- /dev/null +++ b/components/youtube.tsx @@ -0,0 +1,19 @@ +type TableOfContentsProps = { + id: string; + }; + + export function YouTube({ id }: TableOfContentsProps) { + + return ( +
+ +
+ ); + } \ No newline at end of file diff --git a/content/posts/informatics/class-10v.mdx b/content/posts/informatics/class-10v.mdx index d7d68cb..b11b2c7 100644 --- a/content/posts/informatics/class-10v.mdx +++ b/content/posts/informatics/class-10v.mdx @@ -90,6 +90,11 @@ def speed(v,t,s): ## Урок 15.11.23 + + + ~~~python # main.py from mylib import strength_elasticity @@ -111,4 +116,35 @@ def strength_elasticity(f, x, k): if k == 0: return f/x -~~~ \ No newline at end of file +~~~ + +## Урок 16.11.23 + + + +Описание для следующей функции + +~~~python +def strength_elasticity(f, x, k): + if f == 0: + return k*x + if x == 0: + return f/k + if k == 0: + return f/x +~~~ + +Функция strength_elasticity вычисляет коэффициент упругости в зависимости от трех параметров: силы (f), удлинения (x) и жесткости (k). Если один из параметров равен нулю, то функция использует формулу для вычисления коэффициента упругости на основе оставшихся двух параметров. + +Инструкция: +1. Определите значения силы (f), удлинения (x) и жесткости (k). +2. Вызовите функцию strength_elasticity и передайте значения параметров в порядке: f, x, k. +3. Функция вернет значение коэффициента упругости в зависимости от введенных параметров. + +Пример использования: +~~~python +result = strength_elasticity(10, 5, 2) +print(result) # Выведет значение коэффициента упругости +~~~