title: I need to write a code that takes input(sentences) from user and stops at @
body: <p>As i said i need to write this code as my hw however i need to write this in while loop because we dont know how big will user write their sentences or how many sentences they will write. It is going to be a paragraph</p>
  
  <pre><code>string word;
  string parag;
  while (cin &gt;&gt; word)
  {
      parag += word;
      for ( unsigned int k = 0; k &lt; parag.length(); k++ )
      {
          if (parag.at(k) == '@')
          break;
      }
  }
  </code></pre>
  
  <p>I know there are problems here but it wont stop even if i wrote "@". I dont know what to do i am just a beginner. </p>