#include <iostream>

using namespace std;

void sum(double &total, int count);

int main()
{
    int count, num;
    double total = 0.0;

    cout << "Please enter a number: ";
    cin >> num;

    for (count = 1; count <= num; ++count)
    {
        sum(total, count);
    }

    cout << "Your total is: " << total << endl;
    return 0;
}

void sum(double &total, int count)
{
    total += count;
    cout << "Current number: " << count << endl;
    cout << "Total so far: " << total << endl;
}