title: generate unique 5 digit number
body: <p>i was told to write program which generate  unique 5 digit   number ( for example  12345  is unique  and 11234  not)<br>
   i have write following code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;map&gt;
  using namespace std;
  using std::rand;
  const int k=99999-10234;
  bool  unique(int t){
  
      map&lt;int,int&gt;my;
      map&lt;int,int&gt;::iterator it;
      while (t!=0){
          ++my[t%10];
      t/=10;
  }
      for (it=my.begin();it!=my.end();it++){
  
          if ( it-&gt;second&gt;0) {
               return false;
          }
      }
  
         return true;
  }
  int main(){
      int m=0;
       m= 10234+ rand()%k;
      if (unique(m)){
           cout&lt;&lt;" unique number was generated =:"&lt;&lt;m&lt;&lt;" ";
      }
      else{
  
          do{
  
  
               m=10234+rand()%k;
                 if (unique(m)){
                     cout&lt;&lt;"unique  number was generated"&lt;&lt;m&lt;&lt;" ";
                  break;
                 }
  
      }   while(!unique(m));
  
  
      }
  
  
       return 0;
  }
  </code></pre>
  
  <p>but it does not show me  any output  please help me what is bad in my code?</p>