// Oldham, Jeffrey D. // 2000 Jan 16 // CS1321 // // Modified by: // Massingill, Berna L. // 2001 Jan // Unary Natural Numbers Implemented Using Lists (Selected Pieces) #include "unary.h" // ASSUMES the other file is called unary.h. #include #include // has EXIT_SUCCESS // A simple program to test partially your code. Certainly more test // code will need to be written. // Given decimal numbers on the standard input, it prints their sum. // The code assumes + for natural numbers, i.e., operator+(), has been // implemented. int main() { natural total = zero; natural n; while (cin >> n) total = total + n; cout << "The total is " << total << ".\n"; return EXIT_SUCCESS; }