查看原文
其他

你见过这样的代码?

Linux_Daily 混说Linux 2022-11-19

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


#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编译器支持了,修改方法如下:

// gets(str);      // 替换成下面 cin.get(str, n);   // n为str数组的长度

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



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

关注微信公众号『混说Linux』,后台点击 关于混说 即可添加作者微信。




往期回顾




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


您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存