#include "stdafx.h"
#using<system.dll>
#include "time.h"
using namespace System;
using namespace System::IO;
// while ((str = din->ReadLine()) != nullptr) 

double readFile (int riadok,int stlpec, char * name)
{
	String^ nam= gcnew String(name);

	StreamReader^ din = File::OpenText(nam);

      String^ str;
		  String^ a;
	  char ch;

	  int length;
	  int c=0;
	  int count_tab=0;


	  bool bo=false;

      for (int j=0;j<(riadok+1);j++)
	  {
			str = din->ReadLine();
	  }
			
			length= str->Length;
				 for (int i=0;i<length;i++)
				 {
					ch=str[i];	
					if (ch=='\t') count_tab++;

						if (count_tab>=stlpec && count_tab<(stlpec+1))
						{
							if (ch == '.') ch= ',';
							if (ch == 'E') ch= 'e';
							if (ch =='-'&& i==0){
								bo= true; 
								ch=' ';
							}
							a+= System::Convert::ToChar(ch);
						}
				}
		   din->Close();
		   String^ stri;
			 stri = a;	
		   double  num = System::Convert::ToDouble(stri);
   
		if (bo) num= num*(-1.0);	

   return num;
	  
}