title: Stringstreams not working c++
body: <p>I'm trying to solve UVA problem number 482 (permutation arrays), but the thing I want to ask isn't the solution, but why my stringstream in my code doesn't work as I expect them to.</p>
  
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;sstream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  string urutan,nilai,T;
  float zzz;
  int lalala,a;
  
  int main()
  {
      vector&lt;int&gt; line;
      vector&lt;float&gt; numbers;
      vector&lt;float&gt; results;
      stringstream ss1(urutan),ss2(nilai);
      getline(cin,T);
      a = atoi(T.c_str());
      while(a--)
      {
          getline(cin,urutan);
          getline(cin,nilai);
          lalala = 0;
  
          while(ss1 &gt;&gt; zzz)
          {
              line.push_back(zzz);
              lalala++;
          }
          while(ss2 &gt;&gt; zzz)
          {
              numbers.push_back(zzz);
          }
          results.resize(lalala);
  
          for (int i =0; i &lt; lalala; i++)
          {
              results[line[i]-1] = numbers[i];
          }
  
          for(int i = 0; i &lt; lalala; i++)
          {
              cout &lt;&lt; results[i] &lt;&lt; endl;
          }
          numbers.clear();
          results.clear();
          line.clear();
      }   
      return 0;
  }
  </code></pre>
  
  <p>as you can see, there's 2 stringstream operation on the code. But when I try to run, the code seems just skipping the stringstream and cout part!! What's the problem?</p>