#include<iostream>
using namespace std;
//在不改变任何代码的情况下 输出hello world!
int main()
{
cout << "world!" << endl;
return 0;
}
直接使用宏定义进行替换
#include <iostream> using namespace std; #define cout cout << "hello " int main() { cout << "world!" << endl; return 0; }
#include <iostream>
using namespace std;
class A{
public:
A()
{
cout << "hello " ;
}
~A()
{
;
}
};
A a;
int main()
{
cout << "world!" << endl;
return 0;
}
#include <iostream>
#include <stdlib.h>
using namespace std;
class A
{
public:
A()
{
}
~A()
{
system("cls");
cout << "hello world" << endl;
}
};
A a;
int main()
{
cout << "world!" << endl;
return 0;
}
void intbefore()
{
cout << "hello ";
}
#include <iostream>
using namespace std;
void intbefore()__attribute__((constructor));
int main()
{
cout << "world!" << endl;
return 0;
}
void intbefore()
{
cout << "hello ";
}