前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >你见过这样的代码?

你见过这样的代码?

作者头像
混说Linux
发布2022-07-14 19:42:41
1710
发布2022-07-14 19:42:41
举报
文章被收录于专栏:混说Linux混说Linux

刚刚在网上看到这样一段代码,用#define把关键字都替换成一堆下划线,可读性几乎为0。

代码语言:javascript
复制
#include <cstdio> 
#include <string> 
#include <stack> 
#include <algorithm> 
#include <iostream> 
#include <cstring> 
#include <cmath> 
#include <map> 
#include <cstdlib> 
#include <set> 
#include <queue> 
#include <deque> 
#include <vector> 
#include <cctype> 
#include <iomanip> 
#include <sstream> 
#include <set> 
using namespace std; 
#define _____________________ true 
#define __________________ false 
#define ____________________(_______________________) memset(_______________________, 0, sizeof(_______________________)); 
#define _____________________________ if 
#define ______________________________ for 
#define ___________________(______________________) ______________________________(long long ________________________ = 1; ________________________ <= ______________________; ________________________ ++){puts("");} 
#define ____________________________________ getchar 
#define _______________________________________ NULL 
#define ________________________________________ strlen 
#define _______________________________________________________ new 
#define _________________________________ printf 
#define _______________________________ char 
#define ________________________________ int 
#define __________________________________________ void 
#define _____________________________________________ break 
#define ______________________________________________ return 
#define _________________________________________ struct 
#define __________________________________ strcmp 
#define ___________________________________ else 
#define _____________________________________ while 
#define ______________________________________ putchar 
#define ___________________________________________ gets 
#define ____________________________________________ scanf 
#define __________________________________________________________ strcpy 
_______________________________ _[66]; 
_______________________________ ______[66]; 
_______________________________ _______[6666];
_________________________________________ ___________ 
{
    _______________________________ _________[66]; 
    ___________ *_____________[26]; 
}; 
___________ *__, *____, *_______________; 
__________________________________________ ___(___________ *__) 
{ 
    __->_________[0] = ((_______________________________)(0xd16+844-0x103f)); 
    ______________________________(________________________________ ________ = 0; ________ < 26; ________ ++) 
    { 
        __->_____________[________] = _______________________________________; 
    } 
} 
__________________________________________ _____(_______________________________ *_______, _______________________________ *________________) 
{ 
    ____ = __; 
    ______________________________(________________________________ ________ = 0; 
    ________<________________________________________(_______); ________ ++) 
    { 
        ________________________________ ______________ = _______[________] - ((_______________________________)(0x403+759-0x699)); 
        _____________________________(____->_____________[______________] == _______________________________________) 
        { 
            _______________ = _______________________________________________________ ___________; 
            ___(_______________); 
            ____->_____________[______________] = _______________; 
        } 
        ____ = ____->_____________[______________]; 
    } 
    __________________________________________________________(____->_________, ________________); 
} 
___________ *_______________________________________________(_______________________________ *_______) 
{ 
    ________________________________ ________, ______________; 
    ______________________________(________ = 0, ____ = __; ________ < ________________________________________(_______); ________++) 
    { 
        ______________ = _______[________] - ((_______________________________)(0x8d0+7293-0x24ec)); 
        _____________________________(____->_____________[______________] == _______________________________________) 
        { 
            _____________________________________________; 
        } 
        ____ = ____->_____________[______________]; 
    } 
    _____________________________(________ == ________________________________________(_______)) 
    { 
        ______________________________________________ ____; 
    } 
    ___________________________________ 
    { 
        ______________________________________________ _______________________________________; 
    } 
} 
________________________________ main() 
{
    __ = _______________________________________________________ ___________; 
    ___(__); 
    ____ = __; 
    ___________________________________________(_); 
    _____________________________________(____________________________________________("%s", _)) 
    { 
        _____________________________(__________________________________(_, "END") == 0) 
        { 
            _____________________________________________; 
        } 
        ____________________________________________("%s", ______); 
        _____(______, _); 
    } 
    ____________________________________(); 
    ___________________________________________(_); 
    _____________________________________(___________________________________________(_______)) 
    { 
        _____________________________(__________________________________(_______, "END") == 0) 
        { 
            _____________________________________________; 
        } 
        ________________________________ ____________ = ________________________________________(_______); 
        _______[____________] = '\n' 
        ______________________________(________________________________ ________ = 0, _________________ = 0; ________ <= ____________; ________ ++) 
        { 
            _____________________________(_______[________] == ((_______________________________)(0xc97+2515-0x164a))) 
            { 
                ______________________________________(((_______________________________)(0xd85+3715-0x1be8))); 
                ________ ++; 
            } 
            _____________________________(_______[________] >= ((_______________________________)(0x145b+1312-0x191a)) && _______[________] <= ((_______________________________)(0x7b8+6185-0x1f67))) 
            { 
                _____________________________________(_______[________] >= ((_______________________________)(0x1be2+43-0x1bac)) && _______[________] <= ((_______________________________)(0x533+4459-0x1624)) && ________<____________) 
                { 
                    ______[_________________ ++] = _______[________ ++]; 
                } 
                ______[_________________] = '\0' 
                _________________ = 0; 
                ___________ *__________ = _______________________________________________(______); 
                _____________________________(__________ != _______________________________________ && __________->_________[0] != ((_______________________________)(0x23f4+557-0x25fe))) 
                { 
                    _________________________________("%s", __________->_________); 
                } 
                ___________________________________ 
                { 
                    _________________________________("%s", ______); 
                } 
            } 
            _____________________________(!(_______[________] >= ((_______________________________)(0x1285+145-0x12b5)) && _______[________]<=((_______________________________)(0x1f7+8825-0x23f6)))) 
            { 
                _________________________________("%c", _______[________]); 
            } 
        } 
    } 
    ______________________________________________ 0; 
} 

几乎是跪着看完的…...........

最后编译了一遍发现报错:error: ‘gets’ was not declared in this scope gets(s)。

搜索后发现gets()方法已经不被PAT编译器支持了,修改方法如下:

代码语言:javascript
复制
// gets(str);      // 替换成下面 
cin.get(str, n);   // n为str数组的长度

这样就可以正常编译通过了。

免责声明:整理文章为传播相关技术,版权归原作者所有,如有侵权,请联系删除。

分享是一种积极的生活态度

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-09-26,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 混说Linux 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档