title: Partially correct on codeeval
body: <p><strong>This is my answer to a codeeval solution. Shows Partially correct. Cannot figure out why.</strong></p>
  
  <p><a href="https://www.codeeval.com/open_challenges/18/" rel="nofollow">https://www.codeeval.com/open_challenges/18/</a> this is the question.
  Will be glad for the help.</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;fstream&gt;
  #include&lt;sstream&gt;
  #include&lt;cstdlib&gt;
  
  using namespace std;
  
  int main(int argc, char* argv[])
  {
      ifstream infile(argv[1]);
  
      if(!infile.is_open())
      {
          cout &lt;&lt; "Error:Cannot open file!";
          cout &lt;&lt; "Program terminating.\n";
          exit(EXIT_FAILURE);
      }
  
      string line;
      while(getline(infile, line, '\n'))
      {
          stringstream ss(line);
          string token;
  
          getline(ss,token,',');
              long x = stoi(token);
  
          getline(ss, token, ',');
              long n = stoi(token);
  
              while(n &lt; x)
              {
                  n &lt;&lt;= 1;
              }
              cout &lt;&lt; n &lt;&lt; "\n";
      }
      return 0;
  }
  </code></pre>