logo Algo Beat Contest
登录 注册

「文件 IO」题解投稿

作者: jiqihang  ·  发布于 2026-05-05 11:37:57  ·  最后修改于 2026-05-05 11:55:40
已通过

思路

类似于 A+B Problem。

只是要加上文件读写,也就是如下两行代码:

freopen("aplusb.in","r",stdin);
freopen("aplusb.out","w",stdout);

文件读写建议自己百度搜索学习一下。

代码(答案)

#include<bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
    freopen("aplusb.in","r",stdin);
    freopen("aplusb.out","w",stdout); 
    cin>>a>>b;
    cout<<a+b;
}

暂无评论

登录 后即可评论。