1010

#include
#include
#include
#include


using namespace std;

int main()
{
    vector in;
    string s;
    if (getline(cin, s))
    {
        istringstream in_tmp(s);
        int tmp;
        while (in_tmp >> tmp)
        {
            in.push_back(tmp);
        }
    }

    auto beg = in.cbegin();
    string out;

    if (*(beg + 1) == 0)
        out=string("0 0 ");
    else
    {
        for (; beg != in.cend(); beg = beg + 2)
        {
            if(*(beg+1)!=0)
                out = out + to_string((*beg)*(*(beg + 1))) + string(" ")+to_string(*(beg + 1) - 1)+string(" ");
        }
    }
    cout << out.substr(0, out.size() - 1);

    system("pause");
    return 0;
}

你可能感兴趣的:(1010)