Why does this work?
#include #include using namespace std; int main(){ string s=\"a\"; if((s==\"cm\")||(s==\"in\")||(s==\"ft\")||
More specifically, you didn't apply De Morgan's law correctly: http://en.wikipedia.org/wiki/De_Morgan%27s_laws.
De Morgan's law