Когда я запускаю программу, я не могу понять, почему, когда я спрашиваю букву a, b или c, и вводится буква, отличная от этой, почему она идет по «недействительным критериям» вместо «Введен неверный код. Когда я ввожу число вне диапазона, оно переходит к« Введен неверный номер », но не тогда, когда я запрашиваю букву
#include <iostream>
#include <iomanip>
#include "Header.h"
using namespace std;
int main()
{
head();
int num_1, a, b, c;
char char_1;
float num_2;
num_2 = 28.82;
a = b = c = 0;
cout << "Please enter a number between 10 and 30." << endl;
cin >> num_1;
if (num_1 >= 10 && num_1 <= 30)
{
cout << "Enter the letter a, b, or c." << endl;
cin >> char_1;
if (char_1 == 'a'||'b'||'c')
{
if ((num_1 >= 10 && num_1 <= 20) && (char_1 == 'a'))
{
num_2 = num_2 + .5;
cout << fixed << setprecision(1) << num_2 << endl;
}
else if ((num_1 >= 19 && num_1 <= 30) && (char_1 == 'b'))
{
num_2 = num_2 + .10;
cout << fixed << setprecision(2) << num_2 << endl;
}
else if ((num_1 >= 19 && num_1 <= 30) && (char_1 == 'c'))
{
num_2 = num_2 + .100;
cout << fixed << setprecision(3) << num_2 << endl;
}
else
{
cout << "Invalid criteria" << endl;
}
}
else
cout << "An invalid code has been entered."
}
else
cout << "An invalid number has been entered." << endl;
system("pause");
return 0;
}