c++的break和continue的"标签用法"

最近在看FlashActionScript3 , 有个break和continue的标签用法, 觉得其实c++也能实现类似的东东, 代码如下

#include 
int main(int argc, char* argv[])
{
	std::cout << "[begin>" << std::endl;
    for (int i = 0; i < 10; i++)
	{
        for (int j = 0; j < 10; j++) 
		{
            if ((i + j) % 5 == 0) 
			{
                std::cout << "continue i" << std::endl;
                goto continuei;
            }
            if (i == 8 && j == 1)
			{
                std::cout << "break i" << std::endl;
                goto breaki;
            }
            std::cout << i << ", " << j << std::endl;
        }
		continuei: continue;
		breaki: break;
	}

	std::cout << "


 

 

 

 

你可能感兴趣的:(C/C++)