Exemple #1
0
int _tmain(int argc, _TCHAR* argv[])
{
    WidgetRepairs x;
    vector<int> v;
    v.push_back(6);
    v.push_back(5);
    v.push_back(4);
    v.push_back(3);
    v.push_back(2);
    v.push_back(1);
    v.push_back(0);
    v.push_back(0);
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    v.push_back(4);
    v.push_back(5);
    v.push_back(6);
    int result = x.days(v, 3);
    std::cout << result << std::endl;
    return 0;
}
// BEGIN CUT HERE
int main( int argc, char* argv[] )
{
stderr=freopen("Scratch.txt", "w", stderr);
fclose(stdout);
stdout=stderr;
    {
        int arrivalsARRAY[] = { 10, 0, 0, 4, 20 };
        vector <int> arrivals( arrivalsARRAY, arrivalsARRAY+ARRSIZE(arrivalsARRAY) );
        WidgetRepairs theObject;
        eq(0, theObject.days(arrivals, 8),6);
    }
    {
        int arrivalsARRAY[] = { 0, 0, 0 };
        vector <int> arrivals( arrivalsARRAY, arrivalsARRAY+ARRSIZE(arrivalsARRAY) );
        WidgetRepairs theObject;
        eq(1, theObject.days(arrivals, 10),0);
    }
    {
        int arrivalsARRAY[] = { 100, 100 };
        vector <int> arrivals( arrivalsARRAY, arrivalsARRAY+ARRSIZE(arrivalsARRAY) );
        WidgetRepairs theObject;
        eq(2, theObject.days(arrivals, 10),20);
    }
    {
        int arrivalsARRAY[] = { 27, 0, 0, 0, 0, 9 };
        vector <int> arrivals( arrivalsARRAY, arrivalsARRAY+ARRSIZE(arrivalsARRAY) );
        WidgetRepairs theObject;
        eq(3, theObject.days(arrivals, 9),4);
    }
    {
        int arrivalsARRAY[] = { 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6 };
        vector <int> arrivals( arrivalsARRAY, arrivalsARRAY+ARRSIZE(arrivalsARRAY) );
        WidgetRepairs theObject;
        eq(4, theObject.days(arrivals, 3),15);
    }
}