/***************************************
*                                      *
*               メイン                 *
*                                      *
*                                      *
***************************************/

#include <iostream>
#include <cstdlib>
#include "snaps.h"
#include "mcntl.h"
#include "mecon.h"
#include "mkisosu.h"
#include "mfile_open.h"
#include "mkiso.h"


int main()
{
	// 変数宣言
	int seido;
	
	using namespace std;
	
	VersionConfirm();
	cout << "start" << endl;
	zero();
	cout << "zero" << endl;
	cntl();
	file_open();
	cout << "file_open" << endl;
	econ();
	cout << "econ" << endl;
	
	ReadKokunen();
	cout << "read kokunen" << endl;
	
	for( seido = KOUNEN ; seido <= SHIGAKU ; seido++ )
	{
		ReadHiyousha( seido );
		switch( seido ) 
		{
			case KOUNEN :
				cout << "read kounen" << endl;
				break;
			case KOKKYO :
				cout << "read kokkyo" << endl;
				break;
			case CHIKYO :
				cout << "read chikyo" << endl;
				break;
			case SHIGAKU :
				cout << "read shigaku" << endl;
				break;
			default :
				cout << "指定外の数字を検出しました" << endl;
				exit( 1 );
		}
	}
	
	waku();
	cout << "waku" << endl;
	
	tumatumi_cal();
	cout << "tumatumi_cal" << endl;
	
	// 推計開始
	cout << "給付水準調整前 給付費" << endl;
	Atamawari();
	
	read_file();
	cout << "read_flie" << endl;
	
	file_write();
	cout << "flie_write" << endl;
	
	printout();
	cout << "printout" << endl;
	
	if( suikei == 1 )
	{
		cout << "給付水準調整ファイル作成" << endl;
		
		tyousei();
		cout << "tyousei" << endl;
		
		file_write_cut();
		cout << "file_write_cut" << endl;
		
		fprintf( fp_settei , "給付水準調整終了年度     %d\n" , S_C_NENDO );
	}
	if( suikei == 2 )
	{
		read_cut();
		cout << "read_cut" << endl;
	}
	cout << "給付水準調整後 給付費" << endl;
	if( suikei == 2 )
	{
		dokuzi_cal();
	}
	Atamawari();
	printout_2();
	
	fprintf( fp_settei , "\n" );
	cout << "end" << endl;
}
