// textin2.cpp -- reading chars with a while loop
#include <iostream>
using namespace std;
int main()
{
    char ch;
    int count = 0;

    cin.get(ch);        // use the cin.get(ch) function
    while (ch != '#')
    {
        cout << ch;
        count++;
        cin.get(ch);    // use it again 
    }
    cout << "\n" << count << " characters read\n";
    return 0;
}

