Problem with if statement with multiple or conditionals

I am trying to write a program that will perform a grammar check on a very limited customized language of english with japanese suffixes.

I am having trouble understand why I repeatedly get "it is ungrammatical" even though I am inputting man-ga caught fish as my sentence. Every other part works fine up till this part and the code that checks the suffixes also works if the if statement is deleted.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

  //Check if the base of 1st word is one of the nouns, if not ungrammatical

  if(w1base != "man" || w1base != "woman" || w1base != "fish")
 {
     cout << "Your input is not grammatical Eng++";
     return 0;
 }
 // Reset i=0 to cycle through the 2nd word and marker
 i=0;
 // w1Mark is now something after the dash check if it is not -ga  declare un grammatical
 while (w1Mark != "-ga")
 {
     cout << "Your input is not grammatical Eng++";
     return 0;
 }


}
Last edited on
A man is not a woman or a fish.
Think about it.

Your if statement will always be true as long as w1base isn't "man", "woman", and "fish" at the same time.
Last edited on
Topic archived. No new replies allowed.