登录 立即注册
金钱:

Code4App-iOS开发-iOS 开源代码库-iOS代码实例搜索-iOS特效示例-iOS代码例子下载-Code4App.com

判断程序员能力,仅一项和代码有关 [复制链接]

2019-1-14 20:28
iOS雯Ping 阅读:343 评论:0 赞:0
Tag:  

你见过哪些操蛋的代码?

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>

分享到:
我来说两句
facelist
您需要登录后才可以评论 登录 | 立即注册
所有评论(0)
关闭

每日2018年最新白菜彩金

通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| 广东互联网违法和不良信息举报中心|中国互联网举报中心|Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

返回顶部
博聚网