#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "nrutil.h"

int main( int argc, char **argv)
{
	char predFile[50];
	strcpy(predFile,argv[1]);
	int *cutoff5,*cutoff8,index5=1,index8=1,i;
	cutoff5=new int [200];
	cutoff8=new int [200];
	FILE *cutoffFile;
	char line[1000];
	char seps[]=" \n";
	char *token;
	if((cutoffFile=fopen(predFile,"r"))!=NULL){
		if(fgets(line,1000,cutoffFile)!=NULL){
			token=strtok(line,seps);
			while(token!=NULL){
				if(strcmp(token,"cutoff5:")!=0){
					cutoff5[index5++]=atoi(token);
				}
				token=strtok(NULL,seps);
			}
		}
		if(fgets(line,1000,cutoffFile)!=NULL){
			token=strtok(line,seps);
			while(token!=NULL){
				if(strcmp(token,"cutoff8:")!=0){
					cutoff8[index8++]=atoi(token);
				}
				token=strtok(NULL,seps);
			}
		}
	}
	printf("cutoff5: ");
	for(i=1;i<index5;i++) printf("%d ",cutoff5[i]);
	printf("\ncutoff8: ");
	for(i=1;i<index8;i++) printf("%d ",cutoff8[i]);
	printf("\n");
	fclose(cutoffFile);
}
