/*
# anglediffcalc : $Revision$  
# $Date$ 
# Created by $Author$
# Usage : anglediffcalc
# Attention
#   $Loccker$
#  	$State$ 
#
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>                  
#define GLOBAL_DECLARATION
#include "../inc/config.h"

#define DEBUG
#include "genUtil.h"
#include "Test.h"

/*
Example:
typedef struct langlediffcalcInfo {
	float a;
	int   b;
} langlediffcalcInfo;

typedef enum langlediffcalcMode {
	a=0,
	b=1
} langlediffcalcMode;
*/

int
main(int argc, char* argv[]) 
{
	anglediffcalcInfo info;
	FILE *fpt;
	double data[28][3];
	char fname[8]="chktemp";
	int i,j;
	double total=0,average;

	init0(&info);
    argCheck(&info, argc, argv);
    init1(&info);

	DEBUGPRINT("Program Start\n");

	fpt = fopen("chktemp","r");

	for(i=0;i<28;i++){
		for(j=0;j<3;j++){
		
			fscanf(fpt,"%lf",data[i][j]);
			total+=pow(data[i][j],2);
			fprintf(stdout,"%f ",data[i][j]);
		}
		fprintf(stdout,"\n");
	}	
	fclose(fpt);
	average=total/81;
	average=pow(average,0.5);
	fprintf(stdout,"average = %f\n",average);
	

	return EXIT_SUCCESS;
}

void
additionalUsage()
{
	fprintf(stderr, "----- Additional Usage -----\n");
}
