#include <iostream>
#define concat(a, b) a##b
#define aaasm concat(as, m)
using namespace std;
int a, b, ans;
int main() {
cin >> a >> b;
aaasm("movl %0, %%eax" : : "m"(a));
aaasm("movl %0, %%ebx" : : "m"(b));
aaasm("addl %ebx, %eax");
aaasm("movl %%eax, %0" : "=m"(ans));
cout << ans << endl;
return 0;
}
是不是把 include
去掉以后进行预编译再判断程序里有没有 asm
比较准确。。(不过好像正经做题的话也没人天天想着内嵌汇编)