|
|
back to boardwhy my code got WA #2 ? 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 |
|
|