// ex_ch6_12.c
#include <stdio.h>

const int SIZE = 8;

int main(void)
{
	double first[SIZE], second[SIZE];

	printf("Input eight floating point values: ");
	for (int i = 0; i < SIZE; i++)
	{
		scanf("%lf", &first[i]);
		printf("%lf ", first[i]);
	}
	printf("\n");

	for (int i = 0; i < SIZE; i++)
	{
		if (i == 0)
		{
			second[i] = first[i];
		} else 
		{
			second[i] = first[i] + second[i-1];
		}
		printf("%lf ", second[i]);
	}
	printf("\n");
	return 0;
}