Program n1; var a,i: integer; begin readln(a); if (a mod 4 = 0) and (a mod 100<>0) or (a mod 400=0) then writeln ('yes') else writeln ('no'); i:=a; while true do begin i:=i+1; if (i mod 4 = 0) and (i mod 100<>0) or (i mod 400=0) then begin writeln(i); break; end; end; end.
Answers & Comments
Verified answer
Program n1;var a,i: integer;
begin
readln(a);
if (a mod 4 = 0) and (a mod 100<>0) or (a mod 400=0)
then writeln ('yes') else writeln ('no');
i:=a;
while true do
begin
i:=i+1;
if (i mod 4 = 0) and (i mod 100<>0) or (i mod 400=0) then
begin
writeln(i);
break;
end;
end;
end.