//Paragwgh tyxaiwn arithmwn kanonikhs katanomhs me Monte-Carlo methodo. //To aoristo oloklhrwma ths f(x):Gauss den yparxei kai efarmozw monte-carlo. #include #include #include #include #include #include using namespace std; int main() { const int a=0,b=1000; double x,y,f,m,s; int i=0,j; cout<<"\n"; cout<<" PARGWGH TYXAIWN ARITHMWN KANONIKHS KATANOMHS "<<"\n\n";//Mporeis na baleis pollapla \n cout<<"\tDwse thesh koryfhs:"<<"\n";//To \t afhnei proka8orismeno keno cin>>m; cout<<"\tDwse diaspora:"<<"\n"; cin>>s; cout<<"\tPlhthos tyxaiwn arithmwn:"<<"\n"; cin>>j; cout<<"\n"; time_t seconds; time(&seconds); srand((unsigned int) seconds); //Proetoimasia arxeiou e3odou. Ta dedomena 8a tupw8oune se ena arxeio "data.csv" //mesa ston fakelo pou uparxei to .exe sou. string outputname = "data.csv"; ofstream file; if (outputname != "") { if (outputname.rfind(".csv") == -1) outputname += ".csv"; file.open(outputname.c_str()); if (!file) { cerr << "Sfalma: De mporw na anoi3w auto to arxeio (" << outputname << ")." << endl; exit(-1); } } char* buffer = 0; buffer = new char[2000]; //Telos proetoimasia arxeiou e3odou while(i=y) { cout<<" "<