~cpp #include <iostream> #include <fstream> using namespace std; int main() { ifstream fin ("input.txt"); ofstream fout ("output.txt"); char ch; int na[5]={0}; int count=0; while(fin.get(ch)) { na[count%5] += ch; count++; } cout << na[0] << " " << na[1] << " " << na[2] << " " << na[3] << " " << na[4] << endl; fout << na[0] << " " << na[1] << " " << na[2] << " " << na[3] << " " << na[4] << endl; return 0; }