Visual C++ .NET/Statement/switch — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
| |
Версия 15:31, 26 мая 2010
Create a switch Statement
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
int main(void)
{
int x = 2;
switch (x)
{
case 1:
Console::WriteLine("Case 1");
break;
case 5:
case 6:
Console::WriteLine("Case 5 or 6");
break;
default:
Console::WriteLine("Default case");
}
return 0;
}