No older revisions available
No older revisions available
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;
}