Загрузка данных


<mxfile host="app.diagrams.net" modified="2026-10-16T07:50:00.000Z" agent="Mozilla/5.0" version="21.0.0" type="device">
  <diagram id="lab15_task3" name="Задача 3">
    <mxGraphModel dx="1000" dy="1000" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />

        <!-- 1. Начало -->
        <mxCell id="node_start" value="Начало" style="rounded=1;whiteSpace=wrap;html=1;arcSize=50;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="340" y="40" width="120" height="40" as="geometry" />
        </mxCell>

        <!-- 2. Ввод st -->
        <mxCell id="node_input" value="Ввод строки st" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="320" y="110" width="160" height="45" as="geometry" />
        </mxCell>

        <!-- 3. Инициализация таблиц и переменных -->
        <mxCell id="node_init" value="r = {'I', 'V', 'X', 'L', 'C', 'D', 'M'}&#xa;v = {1, 5, 10, 50, 100, 500, 1000}&#xa;s = 0, i = 0" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="290" y="185" width="220" height="60" as="geometry" />
        </mxCell>

        <!-- 4. Внешний цикл st[i] != '\0' -->
        <mxCell id="node_loop_i" value="st[i] ≠ '\0'" style="rhombus;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="330" y="275" width="140" height="65" as="geometry" />
        </mxCell>

        <!-- 5. Сброс n1, n2 и j = 0 -->
        <mxCell id="node_init_n" value="n1 = 0, n2 = 0, j = 0" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="325" y="370" width="150" height="35" as="geometry" />
        </mxCell>

        <!-- 6. Внутренний цикл j < 7 -->
        <mxCell id="node_loop_j" value="j &lt; 7" style="rhombus;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="335" y="435" width="130" height="60" as="geometry" />
        </mxCell>

        <!-- 7. Проверка st[i] = r[j] -->
        <mxCell id="node_check_n1" value="st[i] = r[j]" style="rhombus;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="335" y="525" width="130" height="60" as="geometry" />
        </mxCell>

        <mxCell id="node_set_n1" value="n1 = v[j]" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="345" y="615" width="110" height="30" as="geometry" />
        </mxCell>

        <!-- 8. Проверка st[i + 1] = r[j] -->
        <mxCell id="node_check_n2" value="st[i + 1] = r[j]" style="rhombus;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="330" y="670" width="140" height="60" as="geometry" />
        </mxCell>

        <mxCell id="node_set_n2" value="n2 = v[j]" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="345" y="760" width="110" height="30" as="geometry" />
        </mxCell>

        <!-- 9. Шаг j = j + 1 -->
        <mxCell id="node_step_j" value="j = j + 1" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="345" y="815" width="110" height="30" as="geometry" />
        </mxCell>

        <!-- 10. Условие n1 < n2 -->
        <mxCell id="node_check_val" value="n1 &lt; n2" style="rhombus;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="335" y="880" width="130" height="65" as="geometry" />
        </mxCell>

        <mxCell id="node_sub" value="s = s - n1" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="270" y="975" width="110" height="35" as="geometry" />
        </mxCell>

        <mxCell id="node_add" value="s = s + n1" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="420" y="975" width="110" height="35" as="geometry" />
        </mxCell>

        <!-- 11. Шаг i = i + 1 -->
        <mxCell id="node_step_i" value="i = i + 1" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="345" y="1040" width="110" height="35" as="geometry" />
        </mxCell>

        <!-- 12. Вывод s -->
        <mxCell id="node_out" value="Вывод s" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="580" y="980" width="140" height="45" as="geometry" />
        </mxCell>

        <!-- 13. Конец -->
        <mxCell id="node_end" value="Конец" style="rounded=1;whiteSpace=wrap;html=1;arcSize=50;strokeWidth=1.5;" vertex="1" parent="1">
          <mxGeometry x="590" y="1055" width="120" height="40" as="geometry" />
        </mxCell>

        <!-- Связи (Стрелки) -->
        <mxCell id="e1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_start" target="node_input">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <mxCell id="e2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_input" target="node_init">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <mxCell id="e3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_init" target="node_loop_i">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Внешний цикл: Да -> n1 = 0, n2 = 0, j = 0 -->
        <mxCell id="e_loop_i_yes" value="Да" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;labelBackgroundColor=none;" edge="1" parent="1" source="node_loop_i" target="node_init_n">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Внешний цикл: Нет -> Вывод s -->
        <mxCell id="e_loop_i_no" value="Нет" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=1;exitY=0.5;entryX=0.5;entryY=0;labelBackgroundColor=none;" edge="1" parent="1" source="node_loop_i" target="node_out">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="650" y="308" />
            </Array>
          </mxGeometry>
        </mxCell>

        <mxCell id="e4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_init_n" target="node_loop_j">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Внутренний цикл: Да -> st[i] = r[j] -->
        <mxCell id="e_loop_j_yes" value="Да" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;labelBackgroundColor=none;" edge="1" parent="1" source="node_loop_j" target="node_check_n1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Проверка n1: Да -> n1 = v[j] -->
        <mxCell id="e_check_n1_yes" value="Да" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;labelBackgroundColor=none;" edge="1" parent="1" source="node_check_n1" target="node_set_n1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Проверка n1: Нет -> обход к проверке n2 -->
        <mxCell id="e_check_n1_no" value="Нет" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=1;exitY=0.5;entryX=1;entryY=0.5;labelBackgroundColor=none;" edge="1" parent="1" source="node_check_n1" target="node_check_n2">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="490" y="555" />
              <mxPoint x="490" y="700" />
            </Array>
          </mxGeometry>
        </mxCell>

        <mxCell id="e5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_set_n1" target="node_check_n2">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Проверка n2: Да -> n2 = v[j] -->
        <mxCell id="e_check_n2_yes" value="Да" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;labelBackgroundColor=none;" edge="1" parent="1" source="node_check_n2" target="node_set_n2">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Проверка n2: Нет -> обход к шагу j = j + 1 -->
        <mxCell id="e_check_n2_no" value="Нет" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=1;exitY=0.5;entryX=1;entryY=0.5;labelBackgroundColor=none;" edge="1" parent="1" source="node_check_n2" target="node_step_j">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="490" y="700" />
              <mxPoint x="490" y="830" />
            </Array>
          </mxGeometry>
        </mxCell>

        <mxCell id="e6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_set_n2" target="node_step_j">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Возврат внутреннего цикла: j = j + 1 к ромбу j < 7 -->
        <mxCell id="e_loop_j_back" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="node_step_j" target="node_loop_j">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="310" y="830" />
              <mxPoint x="310" y="465" />
            </Array>
          </mxGeometry>
        </mxCell>

        <!-- Выход из внутреннего цикла: Нет -> проверка n1 < n2 -->
        <mxCell id="e_loop_j_no" value="Нет" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=1;exitY=0.5;entryX=0.5;entryY=0;labelBackgroundColor=none;" edge="1" parent="1" source="node_loop_j" target="node_check_val">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="520" y="465" />
              <mxPoint x="520" y="860" />
              <mxPoint x="400" y="860" />
            </Array>
          </mxGeometry>
        </mxCell>

        <!-- Условие n1 < n2: Да (влево) -> s = s - n1 -->
        <mxCell id="e_val_yes" value="Да" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0;exitY=0.5;entryX=0.5;entryY=0;labelBackgroundColor=none;" edge="1" parent="1" source="node_check_val" target="node_sub">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="325" y="913" />
            </Array>
          </mxGeometry>
        </mxCell>

        <!-- Условие n1 < n2: Нет (вправо) -> s = s + n1 -->
        <mxCell id="e_val_no" value="Нет" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=1;exitY=0.5;entryX=0.5;entryY=0;labelBackgroundColor=none;" edge="1" parent="1" source="node_check_val" target="node_add">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="475" y="913" />
            </Array>
          </mxGeometry>
        </mxCell>

        <!-- Объединение веток s в шаг i = i + 1 -->
        <mxCell id="e_sub_to_step" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_sub" target="node_step_i">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="325" y="1025" />
              <mxPoint x="400" y="1025" />
            </Array>
          </mxGeometry>
        </mxCell>

        <mxCell id="e_add_to_step" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_add" target="node_step_i">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="475" y="1025" />
              <mxPoint x="400" y="1025" />
            </Array>
          </mxGeometry>
        </mxCell>

        <!-- Возврат внешнего цикла: i = i + 1 к ромбу st[i] != '\0' -->
        <mxCell id="e_loop_i_back" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0;entryY=0.5;" edge="1" parent="1" source="node_step_i" target="node_loop_i">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="400" y="1095" />
              <mxPoint x="240" y="1095" />
              <mxPoint x="240" y="308" />
            </Array>
          </mxGeometry>
        </mxCell>

        <!-- Вывод -> Конец -->
        <mxCell id="e_out_to_end" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;" edge="1" parent="1" source="node_out" target="node_end">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
</mxfile>