判断程序员能力,仅一项和代码有关

你见过哪些操蛋的代码?

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 删除

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 2016年国庆假期终于把此书过完,整理笔记和体会于此。 关于书名 书名源于俄罗斯的演员斯坦尼斯拉夫斯基创作的《演员...
    李剑飞的简书阅读 7,310评论 2 65
  • Swift1> Swift和OC的区别1.1> Swift没有地址/指针的概念1.2> 泛型1.3> 类型严谨 对...
    cosWriter阅读 11,144评论 1 32
  • 群众的眼睛并不都是澄澈的,鲁迅眼中的看客们也仍然活着,他们有的近视有的散光,有的夜盲、色盲还有独眼、怪眼,玻璃花眼...
    洛神婺女阅读 143评论 0 1
  • 故事发生在北美的某个城市,这也是我生活中的一些日常,记录下来给自己一个回忆。 喜欢一个人与不喜欢他都有潜在的理由,...
    川语秋芝阅读 380评论 0 0
  • 与快手出海韩国的差异化战略不同(其几乎是根据韩国市场量身定做了一款产品),抖音的所有海外版几乎都只有语言上的差别。...
    浪里个榔阅读 352评论 0 0