//Accumulator1.cpp // tom bailey 25 sep 06 // Request n. // Print the sum of the integers from 1 to n. // Use an object of the accumulator class Summer to track // the sum. #include using std::cin; using std::cout; using std::endl; #include "MyAccumulators1.h" int main() { Summer sum; cout << "Enter last integer in sum: "; int n( 0 ); cin >> n; for( int i=1; i<=n; ++i ) { sum.append( i ); } cout << sum() << endl; return 0; }