Python | C |
---|---|
$\begin{aligned} & \mathrm{a} = \text{int(input())} \\ & \mathrm{b} = \text{int(input())} \\ & \mathrm{c} = \text{int(input())} \\ & \text{if c > a and a > b:} \\ & \qquad \begin{aligned} \mathrm{a} & = \mathrm{c} \\ \mathrm{b} & = \mathrm{a} + \mathrm{b} \end{aligned} \\ & \text{elif b > a or a > c:} \\ & \qquad \begin{aligned} \mathrm{b} & = \mathrm{c} \\ \mathrm{a} & = \mathrm{b} + \mathrm{c} \end{aligned} \\ & \text{else:} \\ & \qquad \begin{aligned} \mathrm{a} & = \mathrm{b} \\ \mathrm{b} & = \mathrm{c} + \mathrm{b} \end{aligned} \\ & \text{print(a, b, c)} \end{aligned}$ | $\begin{aligned} & \text{int a, b, c;} \\ & \text{scanf("\%d", \&a);} \\ & \text{scanf("\%d", \&b);} \\ & \text{scanf("\%d", \&c);} \\ & \text{if (c > a \&\& a > b)}\{ \\ & \qquad \mathrm{a} = \mathrm{c;} \\ & \qquad \mathrm{b} = \mathrm{a} + \mathrm{b;} \\ & \} \\ & \text{else if (b > a || a > c)}\{ \\ & \qquad \mathrm{b} = \mathrm{c;} \\ & \qquad \mathrm{a} = \mathrm{b} + \mathrm{c;} \\ & \} \\ & \text{else}\{ \\ & \qquad \mathrm{a} = \mathrm{b;} \\ & \qquad \mathrm{b} = \mathrm{c} + \mathrm{b;} \\ & \} \\ & \text{printf("\%d \%d \%d", a, b, c);} \end{aligned}$ |
Isprobaj potpuno besplatno!
Registracijom dobivaš besplatan*
pristup dijelu lekcija za svaki predmet.