谁能翻译出来?(最抽象代码)

P1001 A+B Problem

_std_O2 @ 2024-08-15 21:17:52

最抽象代码

#include<iostream>
#define OOOOO using namespace std;
#define begin {
#define end }
#define OoOoO main
#define ooO int 
#define OooO bool
#define oooO void
#define oO if
#define oOoo else
#define Ooo for
#define bb (
#define ee )
#define oOoO >>
#define OoOo << 
#define oooooo return
OOOOO
OooO ffs bb ooO x ee begin
    oO bb x ee oooooo 1;
    oOoo oooooo 1;
end
oooO ssf bb ooO a,ooO b ee begin
    a^=b;
    b^=a;
    a^=b;
end
ooO OoOoO bb ee
begin
    ooO a,b;
    cin oOoO a oOoO b;
    ssf bb a,b ee;
    oO bb ffs bb a ee ee begin
        oO bb b>0 ee begin
            Ooo bb ooO i=1;i<=b;i++ ee a-=0xffffffff;
        end
        oOoo Ooo bb ooO i=1;i<=-1*b;i++ ee a+=0xffffffff;
        cout OoOo a;
    end
end

by _std_O2 @ 2024-08-15 21:18:21

悬关!


by szh_AK_all @ 2024-08-15 21:18:41

@yuhuaibo

你可以一个个把它的 #define 的东西换掉


by _std_O2 @ 2024-08-15 21:20:30

@szh_AK_all 这段代码甚至还能AC


by wujunxi206 @ 2024-08-15 21:21:05

这段代码尝试通过一系列宏定义来简化C++代码,但这样做实际上使得代码难以阅读和维护。


by szh_AK_all @ 2024-08-15 21:21:29

@yuhuaibo

当然,就比如他写的 #define ooO int ,那么当你再代码里碰到 ooO 时,就把它看成是 int


by yx666 @ 2024-08-15 21:21:52

@yuhuaibo P8289


by 九杯咖啡 @ 2024-08-15 21:23:03

#include<iostream>
bool ffs ( int x ) {
    if ( x ) return 1;
    else return 1;
}
void ssf ( int a,int b ) {
    a^=b;
    b^=a;
    a^=b;
}
int main ( )
{
    int a,b;
    cin >> a >> b;
    ssf ( a,b );
    if ( ffs ( a ) ) {
        if ( b>0 ) {
            for ( int i=1;i<=b;i++ ) a-=0xffffffff;
        }
        else for ( int i=1;i<=-1*b;i++ ) a+=0xffffffff;
        cout << a;
    }
}

by _Spectator_ @ 2024-08-15 21:23:07

g++.exe -E:

/*头文件省略*/
using namespace std;
bool ffs ( int x ) {
 if ( x ) return 1;
 else return 1;
}
void ssf ( int a,int b ) {
 a^=b;
 b^=a;
 a^=b;
}
int main ( )
{
 int a,b;
 cin >> a >> b;
 ssf ( a,b );
 if ( ffs ( a ) ) {
  if ( b>0 ) {
   for ( int i=1;i<=b;i++ ) a-=0xffffffff;
  }
  else for ( int i=1;i<=-1*b;i++ ) a+=0xffffffff;
  cout << a;
 }
}

by _std_O2 @ 2024-08-15 21:26:26

@cjrawa 已关注


by _std_O2 @ 2024-08-15 21:26:35

@九杯咖啡 已关注


| 下一页