#include <iostream>
#include <vector>
#include <sstream>
#include <cstdlib>

typedef unsigned int uint32;

using namespace std;

class Processor
{
  public:
    Processor();

    void collectData();

  protected:
    void processData();
    void report(vector < uint32 > &dataForReport);
    string toString(int number);

  private:
     vector < uint32 > m_data;
    uint32 m_n;

};


Processor::Processor()
{
    cout << "unesi broj n :  ";
    cin >> m_n;
    cout << endl;

}


void Processor::collectData()
{
    uint32 temp;
    while (m_n > 0)
    {
       cout << "molim upis broja :  ";
       cin >> temp;
       m_data.push_back(temp);
       cout << endl;
       m_n--;
    }

    processData();

}


string Processor::toString(int number)
{
    stringstream ss;
    ss << number;
    return ss.str();
}


void Processor::processData()
{

    vector < uint32 > tempVec(10, 0);
    for (uint32 i = 0; i < m_data.size(); i++)
    {
       uint32 temp;
       string str;
       str += toString(m_data[i])[0];
       temp = atoi( str.c_str() );
       tempVec[temp]++;
    }

    report(tempVec);

}


void Processor::report(vector < uint32 > &dataForReport)
{
    for (uint32 i = 0; i < dataForReport.size(); i++)
    {
       cout << "broj " << i << " se pojavljuje " << dataForReport[i] <<
          " puta\n";
    }

}


int main()
{
    Processor proc;
    proc.collectData();


    return 0;
}