U E D R , A S I H C RSS

데블스캠프2009/금요일/연습문제/ACM2453/조현태

데블스캠프2009/금요일/연습문제/ACM2453/조현태

123byte
main(a,b,c){while(scanf("%d",&a)&&a){for(b=0;!(a&1<<b);++b);for(c=1<<b;a&c;c<<=1);printf("%u\n",(a|c)&~(c-1)|(c>>b+1)-1);}}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:08
Processing time 0.0159 sec