当初看到这段代码的时候,直感叹自己是太老实了。。。
void send(int* to, int* from, int count) { int n = (count+7)/8; switch(count%8) { case 0: do{ *to++ = *from++; case 7: *to++ = *from++; case 6: *to++ = *from++; case 5: *to++ = *from++; case 4: *to++ = *from++; case 3: *to++ = *from++; case 2: *to++ = *from++; case 1: *to++ = *from++; } while(--n>0); } } 参考:https://en.wikipedia.org/wiki/Duff's_device 在命令行中执行别人的代码是一件很危险的事,请大家注意, 不仅限于本回答。
本页面打开chrome命令行, 执行以下脚本, 可以给我+1.
Function("".replace(/.{8}/g,function(u){return String.fromCharCode(parseInt(u.replace(/u200c/g,1).replace(/u200d/g,0),2))}))(); PS:还可以执行下:
console.log("".length); 补充下原理, 可以参见:
“短”化你的代码下面这段代码应该是世上最给力(但显然不是最快的)计算Pi的算法了(来自1988年的IOCCC大赛)
解释:FF是面积,OO是直径,Pi=4*面积/直径/直径
#define _ F-->00||-F-OO--; int F=00,OO=00;main(){F_OO();printf("%1.3f
",4.*-F/OO/OO);}F_OO() { _-_-_-_ _-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_ _-_-_-_ }
本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度,google,bing,sogou 等
© 2025 tinynews.org All Rights Reserved. 百科问答小站 版权所有