How does this program work
<p>This is my first C++ program. It prints the number of words in the input.</p>

<p>My first question, how does it go into the loop and add to the count? is it every time i type the space character? if so, how does it know I'm trying to count words?</p>

<pre><code>using namespace std;

int main() {
    int count;
    string s;
    count = 0;
    while (cin &gt;&gt; s)
        count++;
    cout &lt;&lt; count &lt;&lt; '\n';
    return 0;
}
</code></pre>

<p>My second question. Can someone explain to me what namespace std means for a begineer?</p>
