1 #include <iostream> 2 #include <fstream> 3 using namespace std; 4 5 6 ifstream fin("sum.in");//填入文件的地址 7 ofstream fout("sum.out"); 8 9 int main() { 10 int a, b; 11 fin >> a >> b; 12 fout << a + b << endl; 13 return (0); 14
1 #include <iostream> 2 #include <fstream> 3 using namespace std; 4 5 6 ifstream fin("sum.in");//填入文件的地址 7 ofstream fout("sum.out"); 8 9 int main() { 10 int a, b; 11 fin >> a >> b; 12 fout << a + b << endl; 13 return (0); 14