U E D R , A S I H C RSS

HASH구하기/강희경,김홍선

HASH 구하기

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

int total(char arr[],int n)
{
	int temp=0;
	for(int i=n;i<=95;i=i+5)
     temp = temp + int (arr[i]);
	return temp;
	
}

void main()
{
	ifstream fin("input.txt");
	char arr[100]={NULL};
	int i=0;
	int a,b,c,d,e;

	while(!fin.eof())
	{
		fin.get(arr[i]);
		i++;
	}

	a=total(arr,0);
	b=total(arr,1);
	c=total(arr,2);
	d=total(arr,3);
	e=total(arr,4);
	cout << a << " " << b << " " << c << " " << d << " " << e<< endl;
	

	
}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:20
Processing time 0.0154 sec