title: Comparing digits and finding numbers with same digits
body: <p>here is my problem.The program needs to print out the number of numbers in the range between m and n which have different digits.For example:m=97,n=104;output:5.I seem to have problem with comparing the numbers and finding a way to check if there are 2 same digits.Here what I've written up till now: </p>
  
  <pre><code>enter code here
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  
  {
  
      int m, n;
  
      cout &lt;&lt; "m=";
      cin &gt;&gt; m;
      cout &lt;&lt; "n=";
      cin &gt;&gt; n;
      for (int i = m; i &lt;=n; ++i)
      {
          if (i &gt;= m &amp;&amp; i &lt;= n)
          {
              while (i &gt; 0)
              {
                  m=i%=10;
                  i/= 10; 
  
                  cout &lt;&lt; m;
              }
          }
      }
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>If you can give me the easiest possible solution.Thanks in advance</p>