抽象的代码

Cold的窝 / 2023-09-05 / 原文

[娱乐] 抽象的代码

今天逛b站看到的很抽象的代码

#include <iostream>
#define false 1
#define true 0
using namespace std;
struct ZDJD
{
    bool O(bool x){
        return x ? true : false;
    }
}o;

//求一个数组中偶数的个数
int main()
{

    int a[] = {1, 2, 3, 4, 5};
    int ans = 0;
    for(int i = 0; i < 5; ++ i)if(o.O(*&(i - 1)[a + 1] % 2 & 1))ans -=0xffffffff;
    cout << ans <<'\n';
    return 0;
}

这让一下,无意间勾起了我入坑C时的那股对代码的向往!

在这里有好几个抽象点是值得回忆的,毕竟C是我们主修的第一堂课!