title: No output from c++ loop
body: <p>Recently I coded a program to choose <em>k</em> numbers from the string in order from left to right to print out the number that has <em>k</em> characters and the smallest that can be made from the string itself
  for example :
  Input :
  3
  89678982
  Output: 672
  Then my code didn't print at all!!
  Code :</p>
  <pre><code>#include&lt;bits/stdc++.h&gt;
  using namespace std;
  int k,j=0,i;
  string s;
  int main() {
      cin&gt;&gt;k&gt;&gt;s;
      for(int i=0;i&lt;s.size();i++) s[i]-=48;
      int the2=0;
      int Min=s[0];
      while(j&lt;0) {
      for(i=the2;i&lt;s.size();i++) {
              if(Min&gt;s[i]) 
              {
                  Min=s[i];
                  break;
              }
          }
          the2=i;
          Min=s[i+1];
          cout&lt;&lt;Min;
          j++;
      }
  }
  </code></pre>
  <p>Why did this happen and how do I fix it?</p>