a.cpp: In function ‘int main()’:
a.cpp:39: error: no matching function for call to ‘find(int&, int)’
#include <iostream>
#include <fstream>
using namespace std;
int minutes, seconds;
char temp;
int array_l;
bool* sees;
int* a;
int saade;
int main()
{
ifstream sisf("raadio.sis");
ofstream valf("raadio.val");
/*
* How many songs?
*/
sisf >> array_l;
int a[array_l];
/*
* Read info and putting info in array
*/
for (int i = 0; i < array_l; i++)
{
sisf >> minutes >> temp >> seconds;
a[i] = 60 * minutes + seconds;
cout << a[i] << endl;
}
sisf >> minutes >> temp >> seconds;
saade = 60 * minutes + seconds;
bool ok = find(saade, 0);
if (ok)
{
valf << "JAH" << "\n";
int n = 0;
for (int i = 0; i < sizeof(sees); ++i)
{
if (sees[i])
{
++n;
}
valf << n << endl;
}
}
return 0;
}
bool find(int saade, int i)
{
if (saade == 0)
{
return true;
}
if (saade < 0)
{
return false;
}
if (i == sizeof(saade))
{
return false;
}
if (find(saade - a[i], i + 1))
{
return true;
}
sees[i] = false;
return find(saade, i + 1);
}