<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
    <attributes>
        <attribute name="name" value=""/>
        <attribute name="authors" value="Vasek"/>
        <attribute name="about" value=""/>
        <attribute name="saved" value="2020-10-01 02:32:42 odp."/>
        <attribute name="created" value="VmFzZWs7VktPVExBTk5COzIwMjAtMDktMjQ7MDk6MDI6MDYgb2RwLjsyNjg1"/>
        <attribute name="edited" value="VmFzZWs7VktPVExBTk5COzIwMjAtMTAtMDE7MDI6MzI6NDIgb2RwLjs1OzI3ODA="/>
    </attributes>
    <function name="Main" type="None" variable="">
        <parameters/>
        <body>
            <declare name="A, fakt" type="Integer" array="False" size=""/>
            <output expression="&quot;Zadej kladn&#233; &#269;&#237;slo jeho&#382; faktori&#225;l m&#225;m spo&#269;&#237;tat:&quot;" newline="True"/>
            <input variable="A"/>
            <if expression="A&gt;0">
                <then>
                    <assign variable="fakt" expression="faktorial(A)"/>
                    <output expression="&quot;Faktorial je: &quot;" newline="True"/>
                    <output expression="fakt" newline="True"/>
                </then>
                <else>
                    <output expression="&quot;Nebylo zad&#225;no kladn&#233; &#269;&#237;slo!&quot;" newline="True"/>
                </else>
            </if>
        </body>
    </function>
    <function name="faktorial" type="Integer" variable="fakt">
        <parameters>
            <parameter name="x" type="Integer" array="False"/>
        </parameters>
        <body>
            <declare name="fakt, i" type="Integer" array="False" size=""/>
            <for variable="i" start="1" end="x" direction="inc" step="1">
                <if expression="i==1">
                    <then>
                        <assign variable="fakt" expression="i"/>
                    </then>
                    <else>
                        <assign variable="fakt" expression="fakt*i"/>
                    </else>
                </if>
            </for>
        </body>
    </function>
</flowgorithm>
