Program summa;
Uses Crt;
Var S,a,n,i:integer;
Begin
Write('vvod kol-va chisel=');
Readln(n);
If n<=100 then
Write('vvod chisel=');
S:=0;
for i:=1 to n do begin
read(a);
If ((a mod 3)=0) and ((a mod 10)=2) then
S:=S+a;
End;
Writeln('vivod summi=',S);
readkey;
End.
что не так в этой программе? исправьте пж
Answers & Comments
Uses Crt;
Var S,a,n,i:integer;
Begin
Write('vvedite kol-vo chisel');
Readln(n);
If n<=100 then
begin
Write('vvod chisel');
S:=0;
for i:=1 to n do begin
read(a);
If ( a mod 3 =0) then
S:=S+a;
End;
Writeln('vivod summi=',S);
readkey;
end;
else
writeln('error,invalid value');
End.