title: why if I insert 1,2,2 as input the result will be 0 instead of one
body: <pre><code>cin &gt;&gt; a &gt;&gt; b &gt;&gt; n; 
  int ans=0; 
  c=max(a,b);
  d=min(a,b);
  while(n&gt;c)
      if(d+c&gt;n) {
      ans++;
      break;
  }
  cout &lt;&lt; ans;
  }
  </code></pre>
  <p>why if I insert 1,2,2 as input the result will be 0 instead of one</p>