A.
Python
C
$\begin{aligned} & \mathrm{a} = \text{int(input())} \\ & \mathrm{s} = 0 \\ & \text{while a >= 0:} \\ & \qquad \begin{aligned} \mathrm{x} & = \mathrm{a} // 10 \\ \mathrm{a} & = \mathrm{a} \% 10 \\ & \text{if x \% 2 == 1:} \\ & \qquad \mathrm{s} = \mathrm{s} + \mathrm{x} \end{aligned} \\ & \text{print(s)} \end{aligned}$
$\begin{aligned} & \text{int a, x, s;} \\ & \text{scanf("\%d", \&a);} \\ & \mathrm{s} = 0; \\ & \text{while (a >= 0)}\{ \\ & \qquad \mathrm{x} = \mathrm{a} / 10; \\ & \qquad \mathrm{a} = \mathrm{a} \% 10; \\ & \qquad \text{if (x \% 2 == 1)} \\ & \qquad \qquad \mathrm{s} = \mathrm{s} + \mathrm{x;} \\ & \} \\ & \text{printf("\%d", s);} \end{aligned}$
B.
$\begin{aligned} & \mathrm{a} = \text{int(input())} \\ & \mathrm{s} = 1 \\ & \text{while a > 0:} \\ & \qquad \begin{aligned} \mathrm{x} & = \mathrm{a} \% 10 \\ \mathrm{a} & = \mathrm{a} // 10 \\ & \text{if x \% 2 == 0:} \\ & \qquad \mathrm{s} = \mathrm{s} + 1 \end{aligned} \\ & \text{print(s)} \end{aligned}$
$\begin{aligned} & \text{int a, x, s;} \\ & \text{scanf("\%d", \&a);} \\ & \mathrm{s} = 1; \\ & \text{while (a > 0)}\{ \\ & \qquad \mathrm{x} = \mathrm{a} \% 10; \\ & \qquad \mathrm{a} = \mathrm{a} / 10; \\ & \qquad \text{if (x \% 2 == 0)} \\ & \qquad \qquad \mathrm{s} = \mathrm{s} + 1; \\ & \} \\ & \text{printf("\%d", s);} \end{aligned}$
C.
$\begin{aligned} & \mathrm{a} = \text{int(input())} \\ & \mathrm{s} = 1 \\ & \text{while a > 0:} \\ & \qquad \begin{aligned} \mathrm{x} & = \mathrm{a} // 10 \\ \mathrm{a} & = \mathrm{a} \% 10 \\ & \text{if x \% 2 == 1:} \\ & \qquad \mathrm{s} = \mathrm{s} + 1 \end{aligned} \\ & \text{print(s)} \end{aligned}$
$\begin{aligned} & \text{int a, x, s;} \\ & \text{scanf("\%d", \&a);} \\ & \mathrm{s} = 1; \\ & \text{while (a > 0)}\{ \\ & \qquad \mathrm{x} = \mathrm{a} / 10; \\ & \qquad \mathrm{a} = \mathrm{a} \% 10; \\ & \qquad \text{if (x \% 2 == 1)} \\ & \qquad \qquad \mathrm{s} = \mathrm{s} + 1; \\ & \} \\ & \text{printf("\%d", s);} \end{aligned}$
D.
$\begin{aligned} & \mathrm{a} = \text{int(input())} \\ & \mathrm{s} = 0 \\ & \text{while a > 0:} \\ & \qquad \begin{aligned} \mathrm{x} & = \mathrm{a} \% 10 \\ \mathrm{a} & = \mathrm{a} // 10 \\ & \text{if x \% 2 == 1:} \\ & \qquad \mathrm{s} = \mathrm{s} + \mathrm{x} \end{aligned} \\ & \text{print(s)} \end{aligned}$
$\begin{aligned} & \text{int a, x, s;} \\ & \text{scanf("\%d", \&a);} \\ & \mathrm{s} = 0; \\ & \text{while (a > 0)}\{ \\ & \qquad \mathrm{x} = \mathrm{a} \% 10; \\ & \qquad \mathrm{a} = \mathrm{a} / 10; \\ & \qquad \text{if (x \% 2 == 1)} \\ & \qquad \qquad \mathrm{s} = \mathrm{s} + \mathrm{x;} \\ & \} \\ & \text{printf("\%d", s);} \end{aligned}$
Isprobaj potpuno besplatno!
Registracijom dobivaš besplatan*pristup dijelu lekcija za svaki predmet.