Something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#include <iostream>
using namespace std;
int main()
{
enum COLORS {RED , BLUE};
int choice;
cin>>choice;
switch (choice)
{
case 0:
cout<<RED<<endl;
break;
case 1:
cout<<BLUE<<endl;
break;
default:
exit(0);
}
return 0;
}
|
Red is 0, Blue is 1.
Last edited on