Pripreme za JESENSKI ROK dostupne odmah!

-

Informatika - 2023./24. jesen - 13.

13. Za koji će se testni primjer whi le petlja izvesti samo jednom?
Python
C
$\begin{aligned} & \mathrm{x~=~int(input())} \\ & \text{while x }!=9\text{:} \\ & \qquad \begin{aligned} & \text{if x \% 3}==0\text{:} \\ & \qquad \mathrm{x~=~x**2} \\ & \text{else:} \\ & \qquad \mathrm{x~=~x~*~3} \end{aligned} \end{aligned}$
$\begin{aligned} & \mathrm{int~x;} \\ & \mathrm{scanf(}\text{"\%d"}\mathrm{,~\&x);} \\ & \text{while~(x~}!=~9\text{)} \\ & \qquad \begin{aligned} & \text{if~(x~\%~3~}==~0\text{)} \\ & \qquad \mathrm{x~=~pow(x,~2);} \\ & \text{else} \\ & \qquad \mathrm{x~=~x~*~3;} \end{aligned} \end{aligned}$
ŠTO ČEKAŠ?

Isprobaj potpuno besplatno!

Registracijom dobivaš besplatan*
pristup dijelu lekcija za svaki predmet.

*Besplatan pristup ne zahtijeva unos kartice.
© 2025, Gradivo.hr