#include<iostream.h>
#include<fstream.h>
#include<strings.h>

// burt rosenberg
// 19 Mar 1997

// helper code for the selection sort routine. Making
// big, pseudorandom test inputs.

const int MAXFILENAME = 200 ;

void main() {

   char filenamebuffer[MAXFILENAME] ;
   char * filename ;
   int n ;

   cout << "Enter filename: " ;
   cin.getline(filenamebuffer, MAXFILENAME) ;
   filename = strtok(filenamebuffer, " \t") ;

   cout << "Enter number of integers to generate: " ;
   cin >> n ;
   if ( n < 1 ) {
      cout << "Input error." ;
      return ;
   }

   ofstream ofs ;
   ofs.open(filename) ;
   
   int i ;
   int b = 31415821 ;
   int a = 1234567 ;

   ofs << n << endl ;
  
   for ( i=0; i<n; i++ ) {
      a = a * b + 1 ;
      ofs << a << endl ;
   }

}
