|  | 
|  | 
| вернуться в форум | Here is my AC program Послано Pimp  13 окт 2005 17:27var m,n,i,k:integer;
 begin
 readln(n,m);k:=0;
 for i:=n to m do
 if odd(i) then inc(k);
 writeln(k);readln;
 end.
Re: Here is my AC program I'd say this is a brute force. Here is mine AC:
 var a,b,c:integer;
 begin
 readln(a,b);
 c:=(b-a+1) div 2;
 if (odd(b)) and (odd(a)) then inc(c);
 writeln(c);
 end.
Re: Here is my AC program Why do you post your ACC programs here ?This is a bad practice.
 
 Edited by author 19.07.2006 16:22
Re: Here is my AC program Послано KIRILL  18 сен 2006 21:49This is shorterb shr 1 - a shr 1 + b and 1
Re: Here is my AC program Послано hhgff  6 июл 2010 12:45(b - a) / 2 + (a % 2 | b % 2)Re: Here is my AC program (b+1)/2-a/2 | 
 | 
|