数字 8 と 9 を除いて、デフォルトは機能しません。10 以降では、最初の整数を使用し、その後の 2 番目の数字を完全に無視するケースとして扱います。助けてください
#include <iostream>
#include <string>
using namespace std;
int main ()
{
char day;
cout << " Enter day of the week " << endl;
cin >> day;
switch (day)
{
case '1' : case '6' : case '7' :
cout << "weekend";
break;
case '2' : case '4' :
cout << "going to C++ Class";
break;
case '3' : case '5' :
cout << "studying for C++ Class";
break;
default :
cout << "invalid day number";
}
system("pause");
return 0;
}