Or and not equal
<p>Why does this work?</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;
int main(){
string s="a";
if((s=="cm")||(s=="in")||(s=="ft")||(s=="m"))
        cout&lt;&lt;s+" Is an illegal value";
else
        cout&lt;&lt;"I like "+s;
        return 0;
} 
</code></pre>

<p><a href="http://ideone.com/7pnYh" rel="nofollow">http://ideone.com/7pnYh</a></p>

<p>but then this doesnt</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;
int main(){
string s="a";
if((s!="cm")||(s!="in")||(s!="ft")||(s!="m"))
        cout&lt;&lt;s+" Is an illegal value";
else
        cout&lt;&lt;"I like "+s;
        return 0;
}  
</code></pre>

<p><a href="http://ideone.com/TXUXA" rel="nofollow">http://ideone.com/TXUXA</a>
The answer i want for both is "I like a" .</p>
