Dodatnih 10 EUR POPUSTA na svaki predmet za maturu pri odabiru!
A.
Python
C
a=int(input()) s=0 while a >= 0: x=a//10 a=a%10 if x % 2 == 1: s=s+x print(s)\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}a=int(input()) s=0 while a >= 0: x=a//10 a=a%10 if x % 2 == 1: s=s+x print(s)
int a, x, s; scanf("%d", &a); s=0; while (a >= 0){ x=a/10; a=a%10; if (x % 2 == 1) s=s+x; } printf("%d", s);\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}int a, x, s; scanf("%d", &a); s=0; while (a >= 0){ x=a/10; a=a%10; if (x % 2 == 1) s=s+x; } printf("%d", s);
B.
a=int(input()) s=1 while a > 0: x=a%10 a=a//10 if x % 2 == 0: s=s+1 print(s)\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}a=int(input()) s=1 while a > 0: x=a%10 a=a//10 if x % 2 == 0: s=s+1 print(s)
int a, x, s; scanf("%d", &a); s=1; while (a > 0){ x=a%10; a=a/10; if (x % 2 == 0) s=s+1; } printf("%d", s);\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}int a, x, s; scanf("%d", &a); s=1; while (a > 0){ x=a%10; a=a/10; if (x % 2 == 0) s=s+1; } printf("%d", s);
C.
a=int(input()) s=1 while a > 0: x=a//10 a=a%10 if x % 2 == 1: s=s+1 print(s)\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}a=int(input()) s=1 while a > 0: x=a//10 a=a%10 if x % 2 == 1: s=s+1 print(s)
int a, x, s; scanf("%d", &a); s=1; while (a > 0){ x=a/10; a=a%10; if (x % 2 == 1) s=s+1; } printf("%d", s);\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}int a, x, s; scanf("%d", &a); s=1; while (a > 0){ x=a/10; a=a%10; if (x % 2 == 1) s=s+1; } printf("%d", s);
D.
a=int(input()) s=0 while a > 0: x=a%10 a=a//10 if x % 2 == 1: s=s+x print(s)\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}a=int(input()) s=0 while a > 0: x=a%10 a=a//10 if x % 2 == 1: s=s+x print(s)
int a, x, s; scanf("%d", &a); s=0; while (a > 0){ x=a%10; a=a/10; if (x % 2 == 1) s=s+x; } printf("%d", s);\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}int a, x, s; scanf("%d", &a); s=0; while (a > 0){ x=a%10; a=a/10; if (x % 2 == 1) s=s+x; } printf("%d", s);
Isprobaj potpuno besplatno!
Registracijom dobivaš besplatan*pristup dijelu lekcija za svaki predmet.