Python
a=[43, 16, 23, 78, 45, 22, 43,36]
s=0
for i in a:
if (i%4==0) and (i%10==6):
s+=i
print(s)
Код на Java
public class Znanija {
public static void main(String args[]) {
int number = 0, i = 0;
for(; i<=100; i++) {
for(; number<=100; number++) {
if(number%4 == 0 && number%10 == 6) {
i += number;
}
System.out.println(i);
Псевдокод
number = 0
i = 0
for i in range (101)
for number in range (101)
if number%4 == 0 and number%10 == 6 then
i = i+number
print(i)
Python
a=[43, 16, 23, 78, 45, 22, 43,36]
s=0
for i in a:
if (i%4==0) and (i%10==6):
s+=i
print(s)
Код на Java
public class Znanija {
public static void main(String args[]) {
int number = 0, i = 0;
for(; i<=100; i++) {
for(; number<=100; number++) {
if(number%4 == 0 && number%10 == 6) {
i += number;
}
}
}
System.out.println(i);
}
}
Псевдокод
number = 0
i = 0
for i in range (101)
for number in range (101)
if number%4 == 0 and number%10 == 6 then
i = i+number
print(i)