#include <iostream>

using namespace std;

double add (double a = 1, double b = 2, double c = 0, double d = 2)
{
    double v;
    v = a + b + c + d;

    return v;
}

int main()
{
    double a;
    double b;
    double c;
    double d;
    double p;

    a = 2;
    b = 5;
    c = 10;
    d = 15;

    p = add(a, b);

    cout << "p = " << p << endl; /// 9

    p = add(a, b, c);

    cout << "p = " << p << endl; /// 19

    p = add(a, b, d);

    cout << "p = " << p << endl; /// 24

    p = add(a, b, c, d);

    cout << "p = " << p << endl; /// 32

    return 0;
}
