// WhileSwitchBreak.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int i = 0;
while (true)
{
switch (i)
{
case 1:
break;
default:
break;
}
cout<<i <<" ";
i++;
if (i>10)
{
break;
}
}
cin>>i;
return 0;
}
结果为:0 1 2 3 4 5 6 7 8 9 10