cs161AWinter2024/switchswitch.cpp

42 lines
712 B
C++

#include <iostream>
using namespace std;
int main(){
char option;
char option2;
cout << "Enter a letter: ";
cin >> option;
cout << "Enter another: ";
cin >> option2;
switch(option){
case 'a':
switch(option2){
case 'a':
cout << "aaaaaaaa" << endl;
break;
case 'b':
cout << "bbbbbbbb" << endl;
break;
default:
cout << "I don't know what that means" << endl;
break;
}
//break;
case 'b':
switch(option2){
case 'c':
cout << "ccccccc" << endl;
break;
default:
cout << "Nope" << endl;
}
break;
default:
cout << "Why" << endl;
}
return 0;
}