#include <stdlib.h>
#include <math.h>
#include <fstream.h>
#include <iostream.h>
#include <strstream.h>
int main(){
ofstream outf("ross.dat");
double a=0.01;
 int NUM=200;//as requested
  double STORAGE[NUM];
  double xx=0.3;
  STORAGE[0]=xx;
  double  x = xx;
  double y;
  for(int i=1; i<200; i++){
   
     if (x<0.5){y=a*(1-sqrt(1-2*x));}
     if (x<1) if (x>0.5){y=1+a*(1-sqrt(2*x-1));}
     if (x<1.5)if(x>1){y=1+a(1-sqrt(3-2*x));}
     if (x<2)if(x>1.5){y=a*(1-sqrt(2*x-3));}

    STORAGE[i]=y;

    x = STORAGE[i];
  }
  outf<<STORAGE[0]<<"\t"<<-2.00<<"\n";
  outf<<STORAGE[0]<<"\t"<<STORAGE[1]<<"\n";
  for(int i=0; i<199;i++){
      outf<<STORAGE[i]<<"\t"<<STORAGE[i+1]<<"\n";
      outf<<STORAGE[i+1]<<"\t"<<STORAGE[i+1]<<"\n";}

}  
