Class CertainSum{ public static void main(String args[]){ java.util.Scanner in = new java.util.Scanner(System.in); long eSum = 0; for(int el, cEl = 0; cEl<12; cEl++) if((el = in.nextInt())>=10 && el<=99 && el%2==0)eSum+=el; System.out.print(eSum); } }
Var a:array [1..12] of integer; i,sum:integer; begin sum:=0; randomize; for i:=1 to 12 do begin a[i]:=random(10,99); if a[i] mod 2 =0 then sum:=sum+a[i]; end; writeln('Сумма четных чисел массива = ',sum); end.
public static void main(String args[]){
java.util.Scanner in = new java.util.Scanner(System.in); long eSum = 0;
for(int el, cEl = 0; cEl<12; cEl++)
if((el = in.nextInt())>=10 && el<=99 && el%2==0)eSum+=el;
System.out.print(eSum);
}
}
i,sum:integer;
begin
sum:=0;
randomize;
for i:=1 to 12 do begin
a[i]:=random(10,99);
if a[i] mod 2 =0 then sum:=sum+a[i];
end;
writeln('Сумма четных чисел массива = ',sum);
end.