"The Trip" expense-equalizing challenge
What you need is a Money class.

class Money
{
    int   value;
    static int normalize(double dallarsAndCents)
    {
        return std::round(dallarsAndCents*100);
    }
    public:
        // Deliberately not using explicit (because I want double;s to auto convert)
        Money(double dallarsAndCents)
           : value(normalize(dallarsAndCents))
        {}

        friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp; out, Money const&amp; m)
        {
            return out &lt;&lt; m.value / 100 &lt;&lt; "." &lt;&lt; std::setw(2) &lt;&lt; std::setfill('0') &lt;&lt; m.value % 100;
        }
        friend std::istream&amp; operator&lt;&lt;(std::istream&amp; in, Money&amp; m)
        {
            double newValue;
            if (in &gt;&gt; newValue) {  // only do assignment if read works.
                m = Money(newValue); 
            }
            return in;
        }


        // Define some arithmetic operations here.

};


You don't want to use new or delete in your code. If you are doing that (and you are not in the very bottom of a class doing resource management) then you are doing it wrong.

Local variables just declare locally. If you need a dyncmaically sized container of objects then use a standard container (std::vector is a good default to start with).

v = new float[n];
....
delete v;


This looks neat and tidy but is not good code. You are susceptible to a memory leak if an exception is thrown. You should be using a container that handles the memory for you.

 std::vector&lt;float&gt;  v(n); // Does the same thing but is exception safe
                           // Look up RIAA for why it is exception safe.


Don't use one line for multiple things.

int n; cin &gt;&gt; n;


This is just lazy. It reads nicer if you use more than one line.

Also read Why is “using namespace std;” considered bad practice? about using namespace;. The reason the standard library is named std and not standard is so that prefixing things is not a major burden. Prefer to use std::cin.

Again the one line thing.

float *v, sum, avg, dif;


It makes it hard to read. The * is on the wrong side because you are squishing things together. Note: The star is part of the type information not the object. This is the opposite of C style.

float*  v;
float   sum = 0.0;
float   avg = 0.0;
float   dif = 0.0;