出现玄学错误,每次都只输出上次算的结果
#include<bits/stdc++.h>
using namespace std;
int main()
{
ofstream pyf("gaojing.py");
pyf<<"with open(\".\\\\input.txt\", \"r+\", encoding=\"utf-8\") as f:\n\
a, b = map(int, f.read().split())\n\
with open(\".\\\\output.txt\", \"w+\", encoding=\"utf-8\") as f:\n\
f.write(str(a + b))";
string a, b, ans;
cin>>a>>b;
ofstream inf("input.txt");
inf<<a<<" "<<b;
system("start python gaojing.py");
freopen("output.txt", "r", stdin);
cin>>ans;
cout<<ans;
}