你见过哪些操蛋的代码?
NO.1
#define TRUE FALSE
NO.2
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: #define NULL (::rand() % 2)
inherit;">
</pre>
NO.3
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
#define if( if(!
</pre>
NO.4
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
#define if(x) if(!(x))
</pre>
NO.5
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
#define if while
</pre>
NO.6
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
if(m_doc->isModified() == true)
{
for(int i = 0;i<100;i++)
{
save();//上次测试提了个bug说保存数据失败,这次保存100次,肯定没有问题了。
}
}
</pre>
NO.7
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
public enum ColorType
{
Green, // 绿色
Hong, // 红色
}
//......
this.curColortype= ColorType.Hong;
</pre>
NO.8
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
enum FiveLine
{
Gold,
Wood,
Water,
Fire,
Earth,
};
</pre>
NO.9
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
(a != b) ? b : a
</pre>
NO.10
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
#include<stdio.h>
void duff_memcpy( char* to, char* from, size_t count ) {
size_t 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);
}
}
void main(void) {
char *s1 = "nihao,woshi helloworld";
char *s2;
s2 = (char *)malloc(strlen(s1));
duff_memcpy(s2,s1,strlen(s1));
printf("%s",s2);
free(s2);
}
</pre>
NO.11
没见过这样的吧,加个网址在里面,但是编译运行正常的哦
<pre style="margin: 0px; padding: 0px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; font-size: inherit; color: inherit; line-height: inherit;">
#include<stdio.h>
using namespace std;
int main(int argc, char *argv[]) {
int i = 10;
http://www.stackoverflow.com
printf("Hello,World");
getchar();
return 1;
}
</pre>
此文来源于网络 若有侵权 请联系晓雯微信:Pingwen20 删除