// p03_15.cpp: Count how often each of the integers
// 0, 1, ...., 15 occurs in an input sequence
#include <iostream>
#include <iomanip>
using namespace std;

int main() {
 int i, a[16] = {0};
 cout << "Enter integers, followed by a nonnumeeric "
         "character:\n";
 while (cin >> i) if (i >= 0 && i < 16) a[i]++;
 cout << "\nThe integers 0, 1, ..., 15 have been entered "
         "with the following frequencies:\n\n";
 cout << "Number    Frequency\n";
 for (i = 0; i<16; ++i)
       if (a[i] > 0)
           cout << setw(4) << i << setw(9) << a[i] << endl;
     return 0;
}
