All pastes #289503 Raw Edit

Miscellany

public text v1 · immutable
#289503 ·published 2006-12-23 05:56 UTC
rendered paste body
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
    int choice;
    cout << "This is a test switch-case, choose a number from 1 ~ 7.";
    cin >> choice

switch(choice)
{
    case 1:
    cout << "You've picked number one. Please pick another number.";

    case 2:
    cout << "You've picked number two. Please pick another number.";

    case 3:
    cout << "You've picked number three. Please pick another number.";

    case 4:
    cout << "You've picked number four. Please pick another number.";

    case 5:
    cout << "You've picked number five. Please pick another number.";

    case 6:
    cout << "You've picked number six. Please pick another number.";

    case 7:
    cout << "You've picked number seven. Please pick another number.";

    default:
    cout << "You didn't pick any number from 1 ~ 7. Please pick again.";
}
}