~cpp 
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
	ifstream input("input.txt"); 
    ofstream output("output.txt"); 

	int i=0;
	char a;
	int sum[5]={0,};

	while (input.eof() == false)
	{
		input >> a;
		sum[i%5]+=(int)a;
		i++;
		}
	for (i=0;i<5;i++)
		cout<<sum[i]<< "  ";
	return 0;
}
Retrieved from http://wiki.zeropage.org/wiki.php/HASH구하기/신소영
last modified 2021-02-07 05:23:20