ProgrammatorNumber1
Program OGE; var count, sum, max, a:integer; begin sum:=0; count:=0; max:=0; while(max<100) do begin readln(a) ; if (a = 0) then break; if (a > 300) then writeln('Invalid number'); if(a mod 17 = 0) then begin sum+=a; count+=1; end; max+=1; end; if(count > 0) and (sum > 0) then begin writeln(sum,' ', count);end else begin writeln('NO!'); end; end.
Answers & Comments
var count, sum, max, a:integer;
begin
sum:=0;
count:=0;
max:=0;
while(max<100) do
begin
readln(a) ;
if (a = 0) then break;
if (a > 300) then writeln('Invalid number');
if(a mod 17 = 0) then
begin
sum+=a;
count+=1;
end;
max+=1;
end;
if(count > 0) and (sum > 0) then begin writeln(sum,' ', count);end
else begin writeln('NO!'); end;
end.