文件读写
clion写代码的时候会有while(cin>>n)无法终止的问题
#include<bits/stdc++.h>
using namespace std;
int main() {
int a,b;
freopen("./t.in","r",stdin);
freopen("./t.out","w",stdout);
while (cin>>a>>b)
cout<<a+b<<endl;
fclose(stdin);
fclose(stdout);
return 0;
}
这样写 , 提交时把文件读写去掉即可