switch(n) {
    case 1:
        case 1 code
        break;
    case 2:
        case 2 code
        break;
    default:
        default code
        break;
}