Why WA on test 8?
Послано
ss 25 мар 2005 20:53
My code:
---------------------------------
|const a:array[1..20]of integer = (2,1,2,0,1,1,2,0,1,1,2,0,1,1,2,0,1,1,2,0);
|
|var n:integer;
|
|begin
| readln(n);
|
| if n=1 then writeln(1) else
| if n=2 then writeln(1) else
| if n=3 then writeln(2) else
| if n=4 then writeln(0)
| else begin
| n:=(n mod 20)-4 ;
| writeln(a[n]);
| end;
|end.