ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1049. Brave Balloonists

why my code got WA #2 ?
Posted by vladimir 10 Dec 2014 23:16
var podschet,a,b,i:integer;
begin
a:=1;
for i:=1 to 10 do
begin
readln(b);
a:=a*b;
end;
for i:=1 to a do
begin
if a mod i=0 then podschet:=podschet+1;
end;
if podschet>9 then podschet:=podschet div 10;
writeln(podschet);
end.

Edited by author 11.12.2014 15:46
Re: why my code got WA #2 ?
Posted by lakerka 15 Feb 2015 23:30
Mistake is in this line:

if podschet>9 then podschet:=podschet div 10;

To take last digit you should be using mod instead of div.

Edited by author 15.02.2015 23:31

Edited by author 15.02.2015 23:31