Pyhton | C |
$\begin{aligned} & \mathrm{n}=25 \\ & \mathrm{i}=2 \\ & \mathrm{~s}=0 \\ & \mathrm{a}=0 \\ & \text { while n }!=0 \text { : } \\ & \qquad \begin{aligned} \mathrm{s} & =\mathrm{s}+\mathrm{n} \\ \mathrm{n} & =\mathrm{n}-\mathrm{i} \\ \mathrm{a} & =\mathrm{a}+1\end{aligned}\end{aligned}$ | $ \begin{aligned} & \text{int } i, n, s, a; \\ & n = 25; \\ & i = 2; \\ & s = 0; \\ & a = 0; \\ & \text{while (n != 0) \{} \\ & \qquad \begin{aligned} & s = s + n; \\ & n = n - i; \\ & a = a + 1; \end{aligned} \\ & \text{\}} \end{aligned} $ |
Isprobaj potpuno besplatno!
Registracijom dobivaš besplatan*
pristup dijelu lekcija za svaki predmet.