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