04-22-2009, 04:17 AM
|
#3
|
FFR Simfile Author
![Retired Staff Retired Staff](../images/icons/usergroups/retired_staff.png)
Join Date: Apr 2006
Location: we traced the call...it's coming from inside the house
Age: 33
Posts: 8,609
|
Re: Codegolf: Write the shortest code you can
Ooh, thanks.
EDIT: Also, I undid an earlier attempt that added two bytes (allocating 256 to a variable, l) so now it's at 131:
Code:
class A{public static void main(String[]a){for(int i=0,j,k;i<256;i++){k=0;for(j=1;j<256;j*=2)if((i&j)>0)k++;System.out.print(k);}}}
Last edited by Patashu; 04-22-2009 at 04:21 AM..
|
|
|