Hello everyone
I have this code to compile it
// non deterministic search
#include <iostream>
#include <fstream>
#include "rand.cpp"
using namespace std;
const int N=100;
void loaddata();
int mysteryfunction (int z);
int main ()
{int a[N+1]; int x; int k; int z; int f;
// array a, item x, index k, parameter z
// returns random index n of x in a[1..N]
loaddata(); // loads a and x
z=1; k=1;
while (k<=N+1)
{if ((a[k]==x) && (z>0))
{f=k; z=mysteryfuncti on(z);}
k=k+1;}
cout << f << endl;}
void loaddata() {SetSeed(2016); cout<<"load data"<<;}
int mysteryfunction ()
{return -N + (int) (NextRand() * (2*N+1));}
but during compilation
* it shows me
4 20 C:\Users\marwa\ Desktop\ndsearc h (1) (4).cpp [Error] rand.cpp: No such file or directory
is there anyone who can help me in solving this problem?
I have this code to compile it
// non deterministic search
#include <iostream>
#include <fstream>
#include "rand.cpp"
using namespace std;
const int N=100;
void loaddata();
int mysteryfunction (int z);
int main ()
{int a[N+1]; int x; int k; int z; int f;
// array a, item x, index k, parameter z
// returns random index n of x in a[1..N]
loaddata(); // loads a and x
z=1; k=1;
while (k<=N+1)
{if ((a[k]==x) && (z>0))
{f=k; z=mysteryfuncti on(z);}
k=k+1;}
cout << f << endl;}
void loaddata() {SetSeed(2016); cout<<"load data"<<;}
int mysteryfunction ()
{return -N + (int) (NextRand() * (2*N+1));}
but during compilation
* it shows me
4 20 C:\Users\marwa\ Desktop\ndsearc h (1) (4).cpp [Error] rand.cpp: No such file or directory
is there anyone who can help me in solving this problem?
Comment