Skip to main content
added 109 characters in body
Source Link

Try to Win, C++

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
    int td, dl, tp, pl;
    td = atoi(argv[1]);
    dl = atoi(argv[2]);
    tp = atoi(argv[3]);
    pl = atoi(argv[4]);
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else if(pl < 10 )
    {
        int sn = dl / pl;
        int sb = td/ pl;
        int si = td / tp; 

        if (sn > si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    else
    {
          cout<<td/13;
    }
    return 0;
}

Try to Win, C++

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
    int td, dl, tp, pl;
    td = atoi(argv[1]);
    dl = atoi(argv[2]);
    tp = atoi(argv[3]);
    pl = atoi(argv[4]);
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else
    {
        int sn = dl / pl;
        int si = td / tp;
        if (sn > si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    return 0;
}

Try to Win, C++

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
    int td, dl, tp, pl;
    td = atoi(argv[1]);
    dl = atoi(argv[2]);
    tp = atoi(argv[3]);
    pl = atoi(argv[4]);
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else if(pl < 10 )
    {
        int sn = dl / pl;
        int sb = td/ pl;
        int si = td / tp; 

        if (sn > si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    else
    {
          cout<<td/13;
    }
    return 0;
}
deleted 4 characters in body
Source Link

Try to Win, C++

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
    int td, dl, tp, pl;
    td = atoi(argv[1]);
    dl = atoi(argv[2]);
    tp = atoi(argv[3]);
    pl = atoi(argv[4]);
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else
    {
        int sn = dl / pl;
        int si = td / tp;
        if (sn > si + 1)
        {
            cout << sn - 1;sn;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    return 0;
}

Try to Win, C++

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
    int td, dl, tp, pl;
    td = atoi(argv[1]);
    dl = atoi(argv[2]);
    tp = atoi(argv[3]);
    pl = atoi(argv[4]);
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else
    {
        int sn = dl / pl;
        int si = td / tp;
        if (sn > si + 1)
        {
            cout << sn - 1;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    return 0;
}

Try to Win, C++

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
    int td, dl, tp, pl;
    td = atoi(argv[1]);
    dl = atoi(argv[2]);
    tp = atoi(argv[3]);
    pl = atoi(argv[4]);
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else
    {
        int sn = dl / pl;
        int si = td / tp;
        if (sn > si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    return 0;
}
Now will accept argv
Source Link

Try to Win, C++

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
    int td, dl, tp, pl;
    cin>>td>>dl>>tp>>pl;td = atoi(argv[1]);
    dl = atoi(argv[2]);
    tp = atoi(argv[3]);
    pl = atoi(argv[4]);
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else
    {
        int sn = dl / pl;
        int si = td / tp;
        if (sn > si + 1)
        {
            cout << sn - 1;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    return 0;
}

Try to Win, C++

#include<iostream>
using namespace std;
int main()
{
    int td, dl, tp, pl;
    cin>>td>>dl>>tp>>pl;
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else
    {
        int sn = dl / pl;
        int si = td / tp;
        if (sn > si + 1)
        {
            cout << sn - 1;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    return 0;
}

Try to Win, C++

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
    int td, dl, tp, pl;
    td = atoi(argv[1]);
    dl = atoi(argv[2]);
    tp = atoi(argv[3]);
    pl = atoi(argv[4]);
    if (pl == 1)
    {
        cout << dl;
        return 0;
    }
    else
    {
        int sn = dl / pl;
        int si = td / tp;
        if (sn > si + 1)
        {
            cout << sn - 1;
            return 0;
        }
        if (sn = si + 1)
        {
            cout << sn;
            return 0;
        }
        if (sn == si)
        {
            cout << sn;
            return 0;
        }
        if (sn < si)
        {
            cout << si;
            return 0;
        }

    }
    return 0;
}
deleted 601 characters in body
Source Link
Loading
Source Link
Loading